Here's the surface
this.gymNameSurface = new Surface({
size: [true, gymDetailItemHeight],
classes: ["gym_name_details"],
content: ['<div id="gym_name_details">',this.options.data.gymName.properties.gymName,'</div>'].join(''),
properties: {
backgroundColor: 'black',
fontSize: "2em",
lineHeight: '72px'
}
})
In cases when the gym name is under a certain # of characters, '2em' is the perfect size. In instances when the gym name is over a certain # of characters, it's too large.
How do I dynamically resize the fontSize of the the text inside the surface if, say, I don't want the surface's width to be > window.innerWidth/2?
Thanks