Prinzessin
I'm new here

Width of a picture generated by font function

Jump to solution

Hello,

is it possible to get the width of a picture that was generated by the CMS font function?

I generate a picture like this:

Example: $CMS_REF(font(font:font_family,size:20,justify:font_justify,yspace:5,xspace:10,filetype:"jpg",height:25,color:"#000000",text_antialiasing:true,text:st_zeile1))$

And after that I need the width / heigt of this image?

0 Kudos
1 Solution

Accepted Solutions
Peter_Jodeleit
Crownpeak employee

This should do the trick:

$CMS_SET(myFontImage, font(....))$

<img src="$CMS_REF(myFontImage)$" width="$CMS_VALUE(myFontImage.width)$" height="$CMS_VALUE(myFontImage.height)$">

Disclaimer: Not tested, typos possible.

Peter

View solution in original post

0 Kudos
2 Replies
Peter_Jodeleit
Crownpeak employee

This should do the trick:

$CMS_SET(myFontImage, font(....))$

<img src="$CMS_REF(myFontImage)$" width="$CMS_VALUE(myFontImage.width)$" height="$CMS_VALUE(myFontImage.height)$">

Disclaimer: Not tested, typos possible.

Peter
0 Kudos

Thank you 🙂

0 Kudos