This says it’s solved, but are there code equivalents for text trimming on every platform? Seems like it’s solved from a Figma standpoint but will still ben an issue in clients.
I don’t want trimming. I want it to respect the line-height property, and display it correctly. At the moment, I can’t use half of my fonts, because they seem completely out of alignment. That’s just unacceptable.
Hey i have solution about this for typescript code, like this:
// Set textAutoResize to "WIDTH_AND_HEIGHT" for the text, not the frame
searchText.textAutoResize = "WIDTH_AND_HEIGHT";
// Center the text vertically by adjusting the y position
const frameHeight = searchFrame.height; // Assuming the frame has a fixed height
const textHeight = searchText.height; // Get the height of the text
const centerYPosition = (frameHeight - textHeight) / 2;
searchText.y = centerYPosition;
Hi all. I have resolved this issue by uploading the misalignment font to fontsquirrel.com and manually adjusting the ascent/descent value until it is aligned. (This will require some trial and error).