Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Dave Calkins
I see that when FreeTypeGL calls FT_Load_Glyph, its using 
FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP.


Do these flags maybe not make sense for this font?

On 1/29/2010 8:58 AM, Dave Calkins wrote:




Windows bitmap fonts within a single FON file are loaded similarly to
TrueType collections, this is, you can access them with various face
indices.  If you say

   ftdump sserife.fon

you can see this in more detail.  Below you can find what I get on my
GNU/Linux box.



When I use ftdump sserife.font on my system I get the same output as 
what you sent.



As a corrolary, if you say

ftview 20 sserife.fon

you won't see anything.  But if you decrease the font size to 11pt,
you should see the first face.  Then press `n' to go to the next face
and increase the font size to 13pt, etc., etc.



What does the Invalid Pixel Size indicate?

The below command succeeds and renders the font text.

ftview 11 sserife.font

The below command fails with invalid pixel size (although on Windows 
the screen output resolution is 96dpi).


ftview -r 96 11 sserife.fon

Also the below commands fail with the invalid pixel size as well.

ftview 10 sserife.fon
ftview 13 sserife.fon

Even when specifying sizes listed from ftdump I still get the invalid 
pixel size.  For example, 11 which works is not listed in the file.


Also, I'm able to use this font in WordPad, for example, and pick 8, 
10, 11, etc. point sizes and it works.



___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype





___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Werner LEMBERG

 What does the Invalid Pixel Size indicate?

sserife is a bitmap font which can't be scaled.  The error means that
at the selected size there isn't a proper face available.

 The below command fails with invalid pixel size (although on Windows
 the screen output resolution is 96dpi).
 
 ftview -r 96 11 sserife.fon

Don't mix up pixel size (which is absolute) and point size (which is
relative to the selected DPI value).  11pt for 72dpi means a glyph
height of 11 pixels; 11pt for 96dpi, however, is 15 pixels (rounded),
and this size isn't available in the font.  At 72dpi, the font
contains faces for 11pt, 13pt, 16pt, 19pt, 24pt, and 32pt.  At 96dpi,
you get faces for 8pt, 10pt, 12pt, 14pt, 18pt, and 24pt.

 Also, I'm able to use this font in WordPad, for example, and pick 8,
 10, 11, etc. point sizes and it works.

If you select a font size in WordPad which is not in the font
(e.g. 11pt at 96dpi), you either get glyphs from a different, scalable
font, or Windows does indeed apply scaling to a bitmap font which
should produce horrible optical results.


Werner


___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Werner LEMBERG

 I see that when FreeTypeGL calls FT_Load_Glyph, its using
 FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP.
 
 Do these flags maybe not make sense for this font?

Well, if bitmap fonts are explicitly disabled, you won't see bitmap
fonts :-)


Werner


___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Dave Calkins



I see that when FreeTypeGL calls FT_Load_Glyph, its using
FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP.

Do these flags maybe not make sense for this font?
 

Well, if bitmap fonts are explicitly disabled, you won't see bitmap
fonts :-)


 Werner

   


The header file seems to indicate that bitmap fonts should still work as 
they'll ignore this flag.  Maybe that isn't happening?


   *   FT_LOAD_NO_BITMAP ::
   * Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this
   * flag.




___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Dave Calkins




Don't mix up pixel size (which is absolute) and point size (which is
relative to the selected DPI value).  11pt for 72dpi means a glyph
height of 11 pixels; 11pt for 96dpi, however, is 15 pixels (rounded),
and this size isn't available in the font.  At 72dpi, the font
contains faces for 11pt, 13pt, 16pt, 19pt, 24pt, and 32pt.  At 96dpi,
you get faces for 8pt, 10pt, 12pt, 14pt, 18pt, and 24pt.

   


Understood.  So is ftview only able to show the first font face in the 
file?  The below, for example, also gives the Invalid Pixel Size 
error, despite ftdump seeming to indicate that face 1 is 11pts.  The 
other sizes also fail with the same error.


ftview -r 72 13 sserife.fon



Also, I'm able to use this font in WordPad, for example, and pick 8,
10, 11, etc. point sizes and it works.
 

If you select a font size in WordPad which is not in the font
(e.g. 11pt at 96dpi), you either get glyphs from a different, scalable
font, or Windows does indeed apply scaling to a bitmap font which
should produce horrible optical results.


   


Is there any way to tell FreeType to scale if necessary to get the size 
I'm asking for?  The text looks fine in WordPad, but as you indicated, 
its hard to say whether or not its substituting another font I guess.


The bottom line is that we want to allow the user to pick a font and 
have it work.  If it doesn't look as good, then they can decide to pick 
something else.  But we want to still be able to render the requested 
face at the requested size.




___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Werner LEMBERG

 I see that when FreeTypeGL calls FT_Load_Glyph, its using
 FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP.

 Do these flags maybe not make sense for this font?

 Well, if bitmap fonts are explicitly disabled, you won't see bitmap
 fonts :-)

 The header file seems to indicate that bitmap fonts should still
 work as they'll ignore this flag.  Maybe that isn't happening?

*   FT_LOAD_NO_BITMAP ::
* Ignore bitmap strikes when loading.  Bitmap-only fonts
* ignore this flag.

Oops, you are right.  My memory failed.  FreeTypeGL should thus
display this font (if you select the correct size).


Werner


___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Werner LEMBERG

 Don't mix up pixel size (which is absolute) and point size (which
 is relative to the selected DPI value).  11pt for 72dpi means a
 glyph height of 11 pixels; 11pt for 96dpi, however, is 15 pixels
 (rounded), and this size isn't available in the font.  At 72dpi,
 the font contains faces for 11pt, 13pt, 16pt, 19pt, 24pt, and 32pt.
 At 96dpi, you get faces for 8pt, 10pt, 12pt, 14pt, 18pt, and 24pt.
 
 Understood.  So is ftview only able to show the first font face in
 the file?

Well, there is no command line option to directly select the face (you
are welcome to add it).  Instead, you have to press the `n' key
repeatedly in the ftview window to walk over all available faces.

 If you select a font size in WordPad which is not in the font
 (e.g. 11pt at 96dpi), you either get glyphs from a different,
 scalable font, or Windows does indeed apply scaling to a bitmap
 font which should produce horrible optical results.
 
 Is there any way to tell FreeType to scale if necessary to get the
 size I'm asking for?

No.  FreeType doesn't scale bitmap fonts.

 The bottom line is that we want to allow the user to pick a font and
 have it work.  If it doesn't look as good, then they can decide to
 pick something else.  But we want to still be able to render the
 requested face at the requested size.

I suggest to disable bitmap fonts altogether since their use is very
limited; IMHO they only make sense as console fonts.  Use the
FT_IS_SCALABLE macro to check for that.


Werner


___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Dave Calkins




I suggest to disable bitmap fonts altogether since their use is very
limited; IMHO they only make sense as console fonts.  Use the
FT_IS_SCALABLE macro to check for that.


 Werner


   


Is it possible for a font file to contain multiple faces where some 
faces in that file are scalable and others are not?  Or is a font file 
as a whole either scalable or not scalable?




___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Werner LEMBERG
 Is it possible for a font file to contain multiple faces where some
 faces in that file are scalable and others are not?  Or is a font
 file as a whole either scalable or not scalable?

The latter.


Werner


___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] problem with MS Sans Serif font

2010-01-29 Thread Dave Calkins




The bottom line is that we want to allow the user to pick a font and
have it work.  If it doesn't look as good, then they can decide to
pick something else.  But we want to still be able to render the
requested face at the requested size.

I suggest to disable bitmap fonts altogether since their use is very
limited; IMHO they only make sense as console fonts.  Use the
FT_IS_SCALABLE macro to check for that.


 Werner




Looks like the windows choose font dialog takes a flag, 
CF_SCALABLEONLY which only presents scalable fonts to the user.  I think 
we'll just make sure to pass in this flag and avoid the issue of 
non-scalable fonts entirely.




___
Freetype mailing list
Freetype@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype