开发者

Size Mismatch Between Swing Fonts and Printable Fonts in Java

I've got a panel displaying a JTextPane backed by a StyledDocument. When I print a string of text in, say Arial 16, the text it prints is the same size as the Arial 16 Word prints. However, the Arial 16 in the JTextPane appears to be smaller than the Arial 16 Word displays. Is there some sort of flaw in the translation of Swing fonts to Windows system fonts or something of the sort that makes it difficult (or impossible) to print accurately?

I can achieve an approximation by scaling down the size of my font before printing, but this never 开发者_如何转开发quite gets me the results I would like, as it's not possible in all cases to reproduce things like equivalent numbers of words on a line, etc.

Has anybody run into this before?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜