thisloke / ng2-fittext

An Angular2+ directive that autoscale the font size of an element until it fit the upper level container dimension.
MIT License
32 stars 15 forks source link

Vertial Align text to center / middle #108

Closed dodomui closed 2 months ago

dodomui commented 2 months ago

Hi, When having dynamic multi lines content, having issue to vertical the text to center. Try flex, table, absolute method all will make ng2-fittext doesn't work properly to auto resize / resize to single line text only.

thisloke commented 2 months ago

Hi @dodomui, thanks for reporting it. In order to address correctly the issue i need to be able to replicate it, can you please provide a working example with https://stackblitz.com or in a repo?

dodomui commented 2 months ago

@thisloke do you try vertical align the text before?

thisloke commented 2 months ago

There are many ways to center a text vertically (on y-axis), it depends on your implementation, that could different from mine.

Anyway, i will help you, but i need to know exactly what's the problem and how to replicate, so sharing the code could be a really good starting point :)

dodomui commented 2 months ago

@thisloke sorry for taking your time. Just notice is not related to ng2-fittext, after trying here. https://stackblitz.com/edit/stackblitz-starters-ywpjgb?file=src%2Fmain.ts

Must be somewhere in my code restrict the vertical alignment.

Thanks a lot