Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Variable pitch fonts
Variable pitch fonts [message #24212] Tue, 05 January 2010 17:41 Go to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Not sure which forum this should live in.

In my software I have a large number of custom controls and the user is permitted to change the fonts/colours etc. that these use.

On Linux there appear to be variable pitch fonts, which cause a vertical offset to all the text drawn with those fonts. I've checked TheIde and discovered a check for Font::FIXEDPITCH. This solves the problem by preventing the user from selecting a variable pitch font, but I have an obvious question remaining:

How are you supposed to draw variable pitch fonts? There certainly doens't seem to be any special code in the CtrlLib library to handle it. Either the font height being returned wrong or there should be a negative y offset applyed to both clipping space and text coords before drawing.

Also, the TheIde strangely doesn't display variable-pitch fonts in it's Format setup window even though the code looks like it should.

Cheers

[Updated on: Tue, 05 January 2010 17:43]

Report message to a moderator

Re: Variable pitch fonts [message #24214 is a reply to message #24212] Tue, 05 January 2010 18:07 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Actually, checking for FIXEDPITCH doesn't even help. For some reason this also excludes StdFont() and a load of other fonts that I want (since they're the only ones that don't look awful).

Any ideas? I'm going to investigate further and see if I can find the root cause of this.
Re: Variable pitch fonts [message #24240 is a reply to message #24214] Wed, 06 January 2010 22:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
mrjt wrote on Tue, 05 January 2010 12:07

Actually, checking for FIXEDPITCH doesn't even help. For some reason this also excludes StdFont() and a load of other fonts that I want (since they're the only ones that don't look awful).

Any ideas? I'm going to investigate further and see if I can find the root cause of this.


FIXEDPITCH actually means MONOSPACE.

I hope terminlogy is correct, this external source (first one googled Smile seems to agree:

http://www.roundhillsoftware.com/MessageCleaner/Help/WordWra p.htm
Re: Variable pitch fonts [message #24255 is a reply to message #24240] Thu, 07 January 2010 17:13 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Ah, that makes sense then. I always think of pitch as up/down, like a flying a plane Smile

Still leaves me with the problem of fonts incorrectly reporting their heights though, I haven't had a chance to look further into it yet.

[Updated on: Thu, 07 January 2010 17:49]

Report message to a moderator

Re: Variable pitch fonts [message #24263 is a reply to message #24255] Thu, 07 January 2010 22:08 Go to previous message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
mrjt wrote on Thu, 07 January 2010 11:13

Ah, that makes sense then. I always think of pitch as up/down, like a flying a plane Smile

Still leaves me with the problem of fonts incorrectly reporting their heights though, I haven't had a chance to look further into it yet.


The height of font in general is tricky bussines. You can ask for the height, but you cannot count on what you get. In fact, some glyphs even exceed character cell boundaries written in TTF metrics - this is by design.

Not ideal, but something we simply have to live with....
Previous Topic: I propose to include function PropRescale.
Next Topic: Painter.DrawImage bug
Goto Forum:
  


Current Time: Mon Nov 18 08:05:03 CET 2019

Total time taken to generate the page: 0.01984 seconds