bugThe FreeType Project - Bugs: bug #38521, Problem at Type1 when fontmatrix...

 
 

bug #38521: Problem at Type1 when fontmatrix is [0.1 0 0 0.1 0 0]

Submitted by:  Dimitrios Papadopoulos <dipapado>
Submitted on:  Fri 15 Mar 2013 02:57:37 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: InvalidPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 21 Mar 2013 01:19:09 PM UTC, comment #5:

Well, my wording was unfortunate. The font is not invalid, indeed. However, it is against all typographical conventions since it is so large. FT_Set_Char_Size sets the nominal size in points, and noone is typesetting a document at a size smaller than 1pt! A frequent typesetting size is 10pt, and at that size your font appears as if it were 1000pt.

What exactly do you mean with `acrobat accepts these fonts'? Have you managed to successfully convert your test.ps file to PDF which acrobat can really display? If yes, please attach it to this bug report.

BTW, you can always use FT_Set_Pixel_Sizes which doesn't impose the typographic 1pt limit since this function is not dependent on the dpi value.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 21 Mar 2013 12:54:01 PM UTC, comment #4:

From the moment that printers accept these fonts i though that Freetype also should accept them. I dont understand why these fonts are invalid. The specs(Type1 font) don't write anything about the limits of the values. Acrobat accept these fonts.

Dimitrios Papadopoulos <dipapado>
Thu 21 Mar 2013 12:35:26 PM UTC, comment #3:

I've just tried to convert your test.ps file with ps2pdf. The resulting PDF file can't be correctly opened by acroread because some numbers overflow.

Looking into the PDF (after decompressing with pdftk), I see that the bboxes of the (subsetted) font with the [0.1 ...] matrix is

/FontBBox [0 -1300 51900 74400]

while the original one (with font matrix [0.001 ...]) has

/FontBBox [0 -13 519 744]

In other words, test.pfa is hundred times larger than usual. Such a font is simply invalid. You should expect problems with acroread if the resulting bounding boxes exceed 32768 units.

I see absolutely no reason to remove the 1pt limit as the smallest valid size displayable by FreeType.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 19 Mar 2013 08:09:32 AM UTC, comment #2:

I develop a postscript interpreter and i use the freetype for creating bitmaps from a font.

I have attached a postscript file which contains 2 fonts.
The fonts are the same except from the font matrix.

Also i have extracted the font with fontmatrix [0.1 0 0 0.1 0 0]

(file #27632, file #27633)

Dimitrios Papadopoulos <dipapado>
Tue 19 Mar 2013 03:53:52 AM UTC, comment #1:

Yes, FT_Set_Char_Size refuses to render fonts at sizes smaller than 1pt. I won't change that, since 1pt is unreadable.

Please explain what kind of font has a [0.1 0 0 0.1 0 0] matrix! I need more details here.

It seems that you are incorrectly accessing a font, or maybe there is a bug in FreeType which prevents correct matrix concatenation.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Fri 15 Mar 2013 02:57:37 PM UTC, original submission:

At the FT_Set_Char_Size there is an explicitly set of the char_width and char_height to 64 if the values are less than that.

I think this is correct when the FontMatrix of a type 1 font is [0.001 0 0 0.001 0 0].

But when the FontMatrix is [0.1 0 0 0.1 0 0] the results are wrong.

Making a small test, i removed this part of the code and the results are correct.

Could you check the correctness and if you think that isn't correct please describe why and what should i do to fix that.

It is easy to reproduce it just does the following.
ask the bitmap of a character from a type 1 font when
pointsize 0.16 with fontmatrix [0.1 0 0 0.1 0 0]

The results should be the same if you used
pointsize 16 with fontmatrix [0.001 0 0 0.001 0 0]

Because of the EM.

Dimitrios Papadopoulos <dipapado>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #27632:  test.pfa added by dipapado (132KiB - application/octet-stream)
file #27633:  test.ps added by dipapado (265KiB - application/postscript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by dipapado (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Mar 2013 12:35:26 PM UTCwlStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Tue 19 Mar 2013 08:09:32 AM UTCdipapadoAttached File-=>Added test.pfa, #27632
      Attached File-=>Added test.ps, #27633
    Tue 19 Mar 2013 03:53:52 AM UTCwlStatusNone=>Need Info
      Assigned toNone=>wl

    Back to the top


    Powered by Savane 3.1-cleanup1