阅读背景:

如何确定在web页面上呈现的字符串的长度(以像素为单位)?

来源:互联网 

If I know the font size (12) and the font family (calibri), is there a way to determine the length (in pixels) a given string will take after it will be rendered? I am absolutely certain about the font and size. Are there any lookup tables for this purpose to determine the length in PHP code itself? I am writing a PHP script to dynamically generate an SVG image which contains various boxes filled with data pulled out of a DB. The problem is that I need to manually wrap the text around and increase the size of the box if the string is big.If I know the font size (12) and the font famil




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: