View Issue Details

IDProjectCategoryView StatusLast Update
0035036LazarusLazUtilspublic2019-02-08 07:01
ReporterOndrej PokornyAssigned ToMichl 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target Version2.0.2Fixed in Version2.1 (SVN) 
Summary0035036: Wrong offsets in free type font subclips
DescriptionThe TrueType glyph loader (ttgload.pas) has a bug in loading composite subglyphs.

The glyph offsets are loaded as unsigned values but they should be loaded as signed values. This results in wrong subglyph position if the first bit of the value is 1 (= negative).
Steps To ReproduceSee the attached project.
Additional InformationPatch included.
TagsNo tags attached.
Fixed in Revision60362
LazTarget2.0.2
Widgetset
Attached Files
  • LazFreeTypeITest.zip (161,925 bytes)
  • before.png (1,292 bytes)
    before.png (1,292 bytes)
  • after.png (1,292 bytes)
    after.png (1,292 bytes)
  • ttgload.pas.patch (789 bytes)
    Index: components/lazutils/ttgload.pas
    ===================================================================
    --- components/lazutils/ttgload.pas	(revision 60354)
    +++ components/lazutils/ttgload.pas	(working copy)
    @@ -1003,13 +1003,13 @@
     
                if new_flags and ARGS_ARE_WORDS <> 0 then
                  begin
    -               k := ftstream.Get_Short;
    -               l := ftstream.Get_Short;
    +               k := SmallInt(ftstream.Get_Short);
    +               l := SmallInt(ftstream.Get_Short);
                  end
                else
                  begin
    -               k := ftstream.Get_Byte;
    -               l := ftstream.Get_Byte;
    +               k := ShortInt(ftstream.Get_Byte);
    +               l := ShortInt(ftstream.Get_Byte);
                  end;
     
                subglyph^.arg1 := k;
    
    ttgload.pas.patch (789 bytes)

Activities

Ondrej Pokorny

2019-02-07 20:49

reporter  

LazFreeTypeITest.zip (161,925 bytes)

Ondrej Pokorny

2019-02-07 20:51

reporter  

before.png (1,292 bytes)
before.png (1,292 bytes)

Ondrej Pokorny

2019-02-07 20:51

reporter  

after.png (1,292 bytes)
after.png (1,292 bytes)

Ondrej Pokorny

2019-02-07 20:52

reporter  

ttgload.pas.patch (789 bytes)
Index: components/lazutils/ttgload.pas
===================================================================
--- components/lazutils/ttgload.pas	(revision 60354)
+++ components/lazutils/ttgload.pas	(working copy)
@@ -1003,13 +1003,13 @@
 
            if new_flags and ARGS_ARE_WORDS <> 0 then
              begin
-               k := ftstream.Get_Short;
-               l := ftstream.Get_Short;
+               k := SmallInt(ftstream.Get_Short);
+               l := SmallInt(ftstream.Get_Short);
              end
            else
              begin
-               k := ftstream.Get_Byte;
-               l := ftstream.Get_Byte;
+               k := ShortInt(ftstream.Get_Byte);
+               l := ShortInt(ftstream.Get_Byte);
              end;
 
            subglyph^.arg1 := k;
ttgload.pas.patch (789 bytes)

Michl

2019-02-07 23:31

developer   ~0113937

Applied. Thank you!

Ondrej Pokorny

2019-02-08 07:01

reporter   ~0113942

Thank you!

Issue History

Date Modified Username Field Change
2019-02-07 20:49 Ondrej Pokorny New Issue
2019-02-07 20:49 Ondrej Pokorny File Added: LazFreeTypeITest.zip
2019-02-07 20:51 Ondrej Pokorny File Added: before.png
2019-02-07 20:51 Ondrej Pokorny File Added: after.png
2019-02-07 20:52 Ondrej Pokorny File Added: ttgload.pas.patch
2019-02-07 21:16 Michl Assigned To => Michl
2019-02-07 21:16 Michl Status new => assigned
2019-02-07 23:31 Michl Fixed in Revision => 60363
2019-02-07 23:31 Michl LazTarget => 2.0.2
2019-02-07 23:31 Michl Note Added: 0113937
2019-02-07 23:31 Michl Status assigned => resolved
2019-02-07 23:31 Michl Fixed in Version => 2.1 (SVN)
2019-02-07 23:31 Michl Resolution open => fixed
2019-02-07 23:31 Michl Target Version => 2.0.2
2019-02-07 23:32 Michl Status resolved => assigned
2019-02-07 23:32 Michl Resolution fixed => reopened
2019-02-07 23:32 Michl Fixed in Revision 60363 => 60362
2019-02-07 23:32 Michl Status assigned => resolved
2019-02-07 23:32 Michl Resolution reopened => fixed
2019-02-08 07:01 Ondrej Pokorny Note Added: 0113942
2019-02-08 07:01 Ondrej Pokorny Status resolved => closed