You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by eiLLFire October 15, 2024
I need the ability to select two or more text objects and align them horizontally based on their individual baselines. This feature would ensure that text objects with different font sizes, line heights, or font families can be aligned along a common baseline, ensuring a uniform appearance in the layout. How do I implement function getBaselinePosition
vartext1=newText('Hello',{left: 100,top: 100,fontSize: 40,});vartext2=newText('World',{fontFamliy: 'xxx',left: 200,top: 150,fontSize: 60,});canvas.add(text1,text2);functiongetBaselinePosition(text){// calculate its baseline based on its font metrics}varbaseline1=getBaselinePosition(text1);varbaseline2=getBaselinePosition(text2);if(baseline1>baseline2){text2.top+=baseline1-baseline2;}else{text1.top+=baseline2-baseline1;}```</div>
The text was updated successfully, but these errors were encountered:
Discussed in #10213
Originally posted by eiLLFire October 15, 2024
I need the ability to select two or more text objects and align them horizontally based on their individual baselines. This feature would ensure that text objects with different font sizes, line heights, or font families can be aligned along a common baseline, ensuring a uniform appearance in the layout. How do I implement function
getBaselinePosition
The text was updated successfully, but these errors were encountered: