Re: Automatically resize font when component size changes?



Bent C Dalager wrote:
In article <1174393441.687014.66540@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<larkmore@xxxxxxx> wrote:
Thanks Andrew, but I kind of hoping there would be something a little
simpler. I've already looked at the FontMetrics as described in my
first post. If I use that, I would have to:

1) Figure out which string is the widest and tallest of all possible
strings. I'm betting it's likely 88:88:88 but to be safe, I'd have to
check all of them for a given font. Some weird font might make
11:11:11 really wide.

If you draw the time as one single string (e.g. "12:34:56") as opposed
to drawing each single digit (and JLabel used in the straight-forward
manner would do the former) then you may also risk (weird) fonts
having compound glyphs (or whatever the technical term is) of pairs of
digits that are wider than twice the width of any one of the digits
involved.

E.g., the string "17" may draw wider than "11" _and_ wider than "77".

That's called kerning. And you are right, the font designer is absolutely free to choose whatever he thinks is nice in the kerning table (table of pairs of characters with the space which has to be shown between these two characters).

Phil
.



Relevant Pages

  • Re: what is the work of kerning for fonts in ms word in font?
    ... "Kerning" is a type of spacing between pairs of characters that would ... smaller font sizes. ...
    (microsoft.public.word.docmanagement)
  • Re: 7-bar display
    ... I would like to display digits with a 7-bar display, ... mitred just like on a pocket calculator. ... Maybe the font solution would be best. ... I just thought of another way you could do your calculator digits. ...
    (comp.infosystems.www.authoring.html)
  • Re: 7-bar display
    ... I would like to display digits with a 7-bar display, ... mitred just like on a pocket calculator. ... Maybe the font solution would be best. ... I just thought of another way you could do your calculator digits. ...
    (comp.infosystems.www.authoring.html)
  • Re: 7-bar display
    ... I would like to display digits with a 7-bar display, ... Maybe the font solution would be best. ... I just thought of another way you could do your calculator digits. ... Also I don't know if it's possible to install a font on Windows without ...
    (comp.infosystems.www.authoring.html)
  • Re: possible to set tracking in Word?
    ... First point is that the spacing in a doc using scalable fonts is already ... Insert>Symbol--Special Characters and using 'em' or 'en' spaces. ... Kerning values are built into the ... font design, so you have no further control other than the smallest font ...
    (microsoft.public.mac.office.word)