* Patch from Graeme Geldenhuys to test postscript name and family name

git-svn-id: trunk@36357 -
This commit is contained in:
michael 2017-05-28 08:49:08 +00:00
parent 42a676620d
commit 5d360ea1c4

View File

@ -193,6 +193,10 @@ type
{ Utility functions } { Utility functions }
procedure TestGetGlyphIndex; procedure TestGetGlyphIndex;
procedure TestGetAdvanceWidth; procedure TestGetAdvanceWidth;
{ General info }
procedure TestPostScriptName;
procedure TestFamilyName;
end; end;
@ -202,6 +206,10 @@ type
published published
{ PostScript data structure } { PostScript data structure }
procedure TestPostScript_ItalicAngle; procedure TestPostScript_ItalicAngle;
{ General info }
procedure TestPostScriptName;
procedure TestFamilyName;
end; end;
@ -358,6 +366,10 @@ type
procedure TestPostScript_maxMemType42; procedure TestPostScript_maxMemType42;
procedure TestPostScript_minMemType1; procedure TestPostScript_minMemType1;
procedure TestPostScript_maxMemType1; procedure TestPostScript_maxMemType1;
{ General info }
procedure TestPostScriptName;
procedure TestFamilyName;
end; end;
implementation implementation
@ -1159,6 +1171,16 @@ begin
AssertEquals('Failed on 12', 1139, FI.GetAdvanceWidth(20)); // '1' AssertEquals('Failed on 12', 1139, FI.GetAdvanceWidth(20)); // '1'
end; end;
procedure TTestLiberationFont.TestPostScriptName;
begin
AssertEquals('Failed on 1', 'LiberationSans', FI.PostScriptName);
end;
procedure TTestLiberationFont.TestFamilyName;
begin
AssertEquals('Failed on 1', 'Liberation Sans', FI.FamilyName);
end;
{ TTestLiberationItalicFont } { TTestLiberationItalicFont }
procedure TTestLiberationItalicFont.SetUp; procedure TTestLiberationItalicFont.SetUp;
@ -1176,6 +1198,16 @@ begin
AssertEquals('Failed on 2', -12.0, FI.ItalicAngle); AssertEquals('Failed on 2', -12.0, FI.ItalicAngle);
end; end;
procedure TTestLiberationItalicFont.TestPostScriptName;
begin
AssertEquals('Failed on 1', 'LiberationSans-Italic', FI.PostScriptName);
end;
procedure TTestLiberationItalicFont.TestFamilyName;
begin
AssertEquals('Failed on 1', 'Liberation Sans', FI.FamilyName);
end;
{ TTestFreeSansFont } { TTestFreeSansFont }
procedure TTestFreeSansFont.SetUp; procedure TTestFreeSansFont.SetUp;
@ -1922,6 +1954,15 @@ begin
AssertEquals('Failed on 1', 0, FI.PostScript.maxMemType1); AssertEquals('Failed on 1', 0, FI.PostScript.maxMemType1);
end; end;
procedure TTestFreeSansFont.TestPostScriptName;
begin
AssertEquals('Failed on 1', 'FreeSans', FI.PostScriptName);
end;
procedure TTestFreeSansFont.TestFamilyName;
begin
AssertEquals('Failed on 1', 'FreeSans', FI.FamilyName);
end;
initialization initialization
RegisterTest({$ifdef fptest}'fpParseTTF',{$endif}TTestEmptyParseTTF{$ifdef fptest}.Suite{$endif}); RegisterTest({$ifdef fptest}'fpParseTTF',{$endif}TTestEmptyParseTTF{$ifdef fptest}.Suite{$endif});