String width via fontmetrics calculation is very slow if there are arabic or persian letters in text

后端 未结 4 1370
一向
一向 2021-01-04 03:50

I have a problem. My application interface works much slower if i use eastern languages there. Especially i felt it in components such as JList, JCombobox, JTable.

4条回答
  •  心在旅途
    2021-01-04 04:12

    Could you try to use Font class' method. public GlyphVector layoutGlyphVector(FontRenderContext frc, char[] text, int start, int limit, int flags)

    ANd use the GlyphVector to measure your string?

    Or TextLayout public TextLayout(String string, Font font, FontRenderContext frc)

提交回复
热议问题