Closed trumbitta closed 9 years ago
I'm using ngFitText in a context where I have several text elements aligned. They have different lenghts, meaning they all resize differently.
Given ngFitText sets line-height: 1, they also lose the alignment.
line-height: 1
A data-fittext-preserve-line-height="true" option, setting the line-height to the value of the original font-size, would be very handy :)
data-fittext-preserve-line-height="true"
I tried myself something around this line of code:
window.getComputedStyle(element[0],null).getPropertyValue("font-size");
But I just couldn't make it properly work inside the algorithm you are using.
Hey, I may have found a simple and elegant-enough solution! Just let me polish it a bit, then I'll close this and submit a pull-request :smiley_cat:
I'm using ngFitText in a context where I have several text elements aligned. They have different lenghts, meaning they all resize differently.
Given ngFitText sets
line-height: 1
, they also lose the alignment.A
data-fittext-preserve-line-height="true"
option, setting the line-height to the value of the original font-size, would be very handy :)I tried myself something around this line of code:
But I just couldn't make it properly work inside the algorithm you are using.