FLTK logo

Re: [fltk.bugs] [MOD] STR #2165: fluid interfacedrawing problems (Linux + XFT)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [MOD] STR #2165: fluid interfacedrawing problems (Linux + XFT) "MacArthur, Ian (SELEX GALILEO, UK)" Nov 29, 2010  
 
> - first, we need to define what exactly we mean by font 
> "height", right? 

Once-upon-a-time we meant pixels (not points or etc) and I always
assumed we meant something simple, like the height of an "H" glyph, so
ignoring descenders and what have you.

But some hosts (I think XFT and OSX) it is less obvious that what we
have is actually pixels now... And I'm not at all sure about
ascenders/descenders/etc.


> - then we need to find the function on all platforms that 
> returns the same values for the same (TT) font

Which (I'm pretty sure) might not exist...

> - finally, we have to find out how to *request* the desired 
> font height

...ditto...

> That all should give us a better result, but it still does 
> not guarantee that the *width* and layout will be the same on 
> every platform... .

Yup.
This is kind of why I wrote the fltk_text_extents() functions... I
wanted to know exactly how tall and how wide the text was *on the
display* so I could size and position things correctly.

There are probably cleverer things that could be done than what I did,
but for my purposes it meant that I could at least draw a bouding box
that I knew fitted the height and width of the text satisfactorily.

It does not make the text "the same" on every host, but it allows me the
tweak the widgets so that the text at least fits neatly on every host...




SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.