the Caret height is not relative to the font size
843806Nov 20 2007 — edited Nov 20 2007I am using a JTextPane - as a RTF editor - where it is possible to change the fonts (size, family .. etc.). The dafault fontsize is 12.
When I increase the fontsize I update the "+StyleConstants.FontSize+" attribute, and everything works fine: the cursor height increases to fit the new font size.
Everything works fine as long as i don't change the font size to be LESS than the DEFAULT value (12).
In this case the cursor (caret ?) height does not get smaller. More precisely, if I change the font size to be 6, the text will be smaller, but the cursor height will remain the same as the one used by font size 12. So the text is displaced to the bottom.
any idea why the cursor does not resize when the font size is less than the default?? As the line (row) height depends upon the cursor hieght the text will always be displaced.
thank you (~_~)
think it has something to do with the DefaultStyledDocument.insertUpdate(DefaultDocumentEvent a_event, AttributeSet a_attr) method but i am not sure...