Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用Java计算行长_Java_Fontmetrics - Fatal编程技术网

用Java计算行长

用Java计算行长,java,fontmetrics,Java,Fontmetrics,我一直在使用LineBreakMeasurer&AttributedString来测量线的长度。然而,我现在需要考虑: 小型股 缩放使每个字符变细/变宽。 间距在每个字符后添加/减去空格。 断字,断行可以出现在单词中的特定位置。 有没有一种方法可以使用Java实现这一点?我需要得到的两件基本东西是: 传递的字符串有多长。 对于传入的字符串和长度,该长度中包含的字符串字符数。 我可以使用LineBreakMeasurer&AttributedString并逐个字符调用它。但是有更好的办法吗 谢谢-

我一直在使用LineBreakMeasurer&AttributedString来测量线的长度。然而,我现在需要考虑:

小型股 缩放使每个字符变细/变宽。 间距在每个字符后添加/减去空格。 断字,断行可以出现在单词中的特定位置。 有没有一种方法可以使用Java实现这一点?我需要得到的两件基本东西是:

传递的字符串有多长。 对于传入的字符串和长度,该长度中包含的字符串字符数。 我可以使用LineBreakMeasurer&AttributedString并逐个字符调用它。但是有更好的办法吗

谢谢-戴夫