Re: Make font size to fit screen

From: John McGrath (ng_at_jpmcgrath.net)
Date: 03/04/05

  • Next message: John McGrath: "Re: UndoManager addEdit problem"
    Date: Fri, 04 Mar 2005 02:06:26 GMT
    
    

    On 3/3/2005 at 12:08:48 PM, SPG wrote:

    > What I need to do is when the user resizes the applet, Simply resize the
    > fonts so that the screen is filled to its max.
    >
    > I thought about looping on every paint call, simlpy increasing the
    > fontsize then checking the font metrics, but that seems a bit
    > heavyweight...

    I don't think you want to compute the font size in the paint() call.
    Instead, use a ComponentListener to listen for componentResized() events,
    compute all of the metrics needed for painting, and save the results.
    Then, use the saved results in your paint() method.

    Chances are that your UI will be repainted *many* more times than it is
    resized. Why recompute the metrics on every repaint?

    -- 
    Regards,
    John McGrath
    

  • Next message: John McGrath: "Re: UndoManager addEdit problem"

    Relevant Pages

    • Re: Does anyone know how to blur a font to make it barely legible?
      ... If you aren't using a font that looks blurred, ... paste multiple copies into Paint and slightly offset each ... >> Jay Freedman ... >> newsgroup so all may benefit. ...
      (microsoft.public.word.docmanagement)
    • Re: Script.fon -- how to convert to ttf, or freeware equivalent?
      ... The best way is probably to find similar ttf font. ... I also downloaded a whole bunch of script fonts and they just don't do ... So it comes back to this, I think: why does Paint not see this font ... step-by-step tutorial screenshots a week. ...
      (comp.fonts)
    • Re: Fonts, Part 2
      ... Create your page or portion of the page with the font you want. ... Then open Paint, click Edit, select Paste and an image of the page will appear ... When you have the area you want in the Cut box, click Edit and select Cut. ...
      (microsoft.public.frontpage.client)
    • Problems Measuring Font Height
      ... I am trying to figure out how high a particular font will paint. ... using Courier and Courier New fonts and have recently found some problems ... The problem is that I paint the text with OPAQUE background mode (I do not ...
      (microsoft.public.win32.programmer.gdi)
    • Re: Modifying TeX Font Metrics under LPPL
      ... Practically every .vf file around contains font metrics. ... TFM and DVI information. ... The preamble is followed by zero or more character packets, ...
      (comp.text.tex)