diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-07-23 14:58:51 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-07-23 14:58:51 +0000 |
commit | 66f499d9516f60a650a114a865687f4eb9ffaadd (patch) | |
tree | 542273eb682dc25404cb77bb1a85fffc15a8afe3 /unicode/src/lib/freetype | |
parent | 0d954628b4a8640d71643af095bf3ba205f33a43 (diff) | |
download | usdx-66f499d9516f60a650a114a865687f4eb9ffaadd.tar.gz usdx-66f499d9516f60a650a114a865687f4eb9ffaadd.tar.xz usdx-66f499d9516f60a650a114a865687f4eb9ffaadd.zip |
some missing freetype functions added to headers
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1859 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'unicode/src/lib/freetype')
-rw-r--r-- | unicode/src/lib/freetype/demo/engine-test.bdsproj | 14 | ||||
-rw-r--r-- | unicode/src/lib/freetype/demo/engine-test.dpr | 16 | ||||
-rw-r--r-- | unicode/src/lib/freetype/demo/engine-test.lpi | 39 | ||||
-rw-r--r-- | unicode/src/lib/freetype/freetype.pas | 8 | ||||
-rw-r--r-- | unicode/src/lib/freetype/ftglyph.inc | 23 | ||||
-rw-r--r-- | unicode/src/lib/freetype/ftimage.inc | 14 | ||||
-rw-r--r-- | unicode/src/lib/freetype/fttypes.inc | 10 |
7 files changed, 87 insertions, 37 deletions
diff --git a/unicode/src/lib/freetype/demo/engine-test.bdsproj b/unicode/src/lib/freetype/demo/engine-test.bdsproj index 9547f18f..e5b3e97d 100644 --- a/unicode/src/lib/freetype/demo/engine-test.bdsproj +++ b/unicode/src/lib/freetype/demo/engine-test.bdsproj @@ -27,13 +27,13 @@ <Compiler Name="I">1</Compiler>
<Compiler Name="J">0</Compiler>
<Compiler Name="K">0</Compiler>
- <Compiler Name="L">1</Compiler>
- <Compiler Name="M">0</Compiler>
- <Compiler Name="N">1</Compiler>
- <Compiler Name="O">0</Compiler>
- <Compiler Name="P">1</Compiler>
- <Compiler Name="Q">0</Compiler>
- <Compiler Name="R">0</Compiler>
+ <Compiler Name="L">1</Compiler> + <Compiler Name="M">0</Compiler> + <Compiler Name="N">1</Compiler> + <Compiler Name="O">1</Compiler> + <Compiler Name="P">1</Compiler> + <Compiler Name="Q">0</Compiler> + <Compiler Name="R">0</Compiler> <Compiler Name="S">0</Compiler>
<Compiler Name="T">0</Compiler>
<Compiler Name="U">0</Compiler>
diff --git a/unicode/src/lib/freetype/demo/engine-test.dpr b/unicode/src/lib/freetype/demo/engine-test.dpr index 80177735..bbd7d890 100644 --- a/unicode/src/lib/freetype/demo/engine-test.dpr +++ b/unicode/src/lib/freetype/demo/engine-test.dpr @@ -27,7 +27,9 @@ uses ctypes in '../../ctypes/ctypes.pas', {$ENDIF} FreeType in '../freetype.pas', - UFont in '../../../base/UFont.pas', + UFont in 'UFont.pas', + //UFont in '../../../base/UFont.pas', + UUnicodeUtils in '../../../base/UUnicodeUtils.pas', math, sysutils; @@ -41,7 +43,7 @@ const //FONT_FILE = 'C:/Windows/Fonts/Arial.ttf'; //FONT_FILE = 'C:/Windows/Fonts/SimSun.ttf'; //FONT_FILE = 'eurostarregularextended.ttf'; - FONT_FILE = 'FreeSans.ttf'; + FONT_FILE = '../../../../game/fonts/FreeSans/FreeSans.ttf'; var OurFont: TScalableFont; @@ -129,11 +131,11 @@ begin // Really Nice Perspective Calculations glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); - //OurFont := TFTScalableFont.Create(FONT_FILE, 64); + OurFont := TFTScalableFont.Create(FONT_FILE, 64, 0.03); //OurFont := TFTFont.Create(FONT_FILE, 128); - OurFont := TFTScalableOutlineFont.Create(FONT_FILE, 64, 0.05); + //OurFont := TFTScalableOutlineFont.Create(FONT_FILE, 64, 0.03); //OurFont.UseKerning := false; - TFTScalableOutlineFont(OurFont).SetOutlineColor(1, 0, 0); + //TFTScalableOutlineFont(OurFont).SetOutlineColor(1, 0, 0, 1); //OurFont := TOutlineFont.Create(FONT_FILE, 32, 2); //OurFont.LineSpacing := OurFont.LineSpacing * 0.5; @@ -183,7 +185,7 @@ begin //OurFont.SetOutlineColor(0.5, 0.5, 0.5); //OurFont.ReflectionSpacing := -4; //OurFont.UseKerning := false; - OurFont.Height := 64;//cnt2; + OurFont.Height := 150;//cnt2; //OurFont.Reset; //OurFont.Aspect := 2; @@ -191,7 +193,7 @@ begin bounds := OurFont.BBox(msg); //glRectf(bounds.Left, OurFont.Ascender, bounds.Right, OurFont.Ascender-OurFont.Height); - glColor3f(1, 1, 1); + glColor4f(1, 1, 1, 1); //OurFont.ReflectionSpacing := 0; OurFont.Print(msg); diff --git a/unicode/src/lib/freetype/demo/engine-test.lpi b/unicode/src/lib/freetype/demo/engine-test.lpi index 6cbfe1eb..45483a56 100644 --- a/unicode/src/lib/freetype/demo/engine-test.lpi +++ b/unicode/src/lib/freetype/demo/engine-test.lpi @@ -28,14 +28,14 @@ </local>
</RunParams>
<Units Count="16">
- <Unit0>
- <Filename Value="engine-test.dpr"/>
- <IsPartOfProject Value="True"/>
- <CursorPos X="25" Y="135"/>
- <TopLine Value="118"/>
- <EditorIndex Value="0"/>
- <UsageCount Value="72"/>
- <Loaded Value="True"/>
+ <Unit0> + <Filename Value="engine-test.dpr"/> + <IsPartOfProject Value="True"/> + <CursorPos X="18" Y="25"/> + <TopLine Value="1"/> + <EditorIndex Value="0"/> + <UsageCount Value="72"/> + <Loaded Value="True"/> </Unit0>
<Unit1>
<Filename Value="JEDI-SDL\OpenGL\Pas\opengl12.pas"/>
@@ -139,13 +139,22 @@ <UnitName Value="UFont"/>
<CursorPos X="15" Y="1752"/>
<TopLine Value="1734"/>
- <UsageCount Value="10"/>
- </Unit15>
- </Units>
- <JumpHistory Count="0" HistoryIndex="-1"/>
- </ProjectOptions>
- <CompilerOptions>
- <Version Value="8"/>
+ <UsageCount Value="10"/> + </Unit15> + </Units> + <JumpHistory Count="2" HistoryIndex="1"> + <Position1> + <Filename Value="engine-test.dpr"/> + <Caret Line="52" Column="10" TopLine="37"/> + </Position1> + <Position2> + <Filename Value="engine-test.dpr"/> + <Caret Line="1" Column="1" TopLine="1"/> + </Position2> + </JumpHistory> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> <PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\JEDI-SDL\SDL\Pas\"/>
diff --git a/unicode/src/lib/freetype/freetype.pas b/unicode/src/lib/freetype/freetype.pas index dd8a141e..6aaa3b59 100644 --- a/unicode/src/lib/freetype/freetype.pas +++ b/unicode/src/lib/freetype/freetype.pas @@ -55,7 +55,7 @@ uses const {$IF Defined(MSWINDOWS)} - ft_lib = 'libfreetype-6.dll'; + ft_lib = 'freetype6.dll'; {$ELSEIF Defined(DARWIN)} ft_lib = 'libfreetype.dylib'; {$LINKLIB libfreetype} @@ -1813,6 +1813,12 @@ const pixel_height : FT_UInt ) : FT_Error; cdecl; external ft_lib name 'FT_Set_Pixel_Sizes'; +const + FT_ANGLE_PI = 180 shl 16; + FT_ANGLE_2PI = FT_ANGLE_PI * 2; + FT_ANGLE_PI2 = FT_ANGLE_PI div 2; + FT_ANGLE_PI4 = FT_ANGLE_PI div 4; + implementation diff --git a/unicode/src/lib/freetype/ftglyph.inc b/unicode/src/lib/freetype/ftglyph.inc index 577e448b..0d4acc99 100644 --- a/unicode/src/lib/freetype/ftglyph.inc +++ b/unicode/src/lib/freetype/ftglyph.inc @@ -214,6 +214,29 @@ out aglyph: FT_Glyph ): FT_Error; cdecl; external ft_lib name 'FT_Get_Glyph'; + (*************************************************************************) + (* *) + (* <Function> *) + (* FT_Glyph_Copy *) + (* *) + (* <Description> *) + (* A function used to copy a glyph image. Note that the created *) + (* @FT_Glyph object must be released with @FT_Done_Glyph. *) + (* *) + (* <Input> *) + (* source :: A handle to the source glyph object. *) + (* *) + (* <Output> *) + (* target :: A handle to the target glyph object. 0~in case of *) + (* error. *) + (* *) + (* <Return> *) + (* FreeType error code. 0~means success. *) + (* *) + function FT_Glyph_Copy(source: FT_Glyph; + var target: FT_Glyph ): FT_Error; + cdecl; external ft_lib name 'FT_Glyph_Copy'; + {$ENDIF TYPE_DECL} {$IFDEF TYPE_DECL} diff --git a/unicode/src/lib/freetype/ftimage.inc b/unicode/src/lib/freetype/ftimage.inc index a6babc98..9255c422 100644 --- a/unicode/src/lib/freetype/ftimage.inc +++ b/unicode/src/lib/freetype/ftimage.inc @@ -61,6 +61,8 @@ y : FT_Pos; end; + PFT_VectorArray = ^FT_VectorArray; + FT_VectorArray = array[0 .. (MaxInt div SizeOf(FT_Vector))-1] of FT_Vector; (*************************************************************************) (* *) @@ -261,14 +263,14 @@ const (* *) PFT_Outline = ^FT_Outline; FT_Outline = record - n_contours: FT_Short; (* number of contours in glyph *) - n_points: FT_Short; (* number of points in the glyph *) + n_contours: FT_Short; (* number of contours in glyph *) + n_points: FT_Short; (* number of points in the glyph *) - points: PFT_Vector; (* the outline's points *) - tags: PChar; (* the points flags *) - contours: PFT_Short; (* the contour end points *) + points: PFT_VectorArray; (* the outline's points *) + tags: PByteArray; (* the points flags *) + contours: PFT_ShortArray; (* the contour end points *) - flags: FT_Int; (* outline masks *) + flags: FT_Int; (* outline masks *) end; {$ELSE TYPE_DECL} diff --git a/unicode/src/lib/freetype/fttypes.inc b/unicode/src/lib/freetype/fttypes.inc index c77dd1e8..a64432e6 100644 --- a/unicode/src/lib/freetype/fttypes.inc +++ b/unicode/src/lib/freetype/fttypes.inc @@ -86,7 +86,13 @@ (* values 1 and 0 represent true and false, respectively. *) (* *) FT_Bool = cuchar; - +{$ENDIF TYPE_DECL} +{$IFNDEF TYPE_DECL} +const + FT_FALSE = 0; + FT_TRUE = 1; +{$ENDIF !TYPE_DECL} +{$IFDEF TYPE_DECL} (*************************************************************************) (* *) @@ -123,6 +129,8 @@ FT_Short = csshort; PFT_Short = ^FT_Short; + PFT_ShortArray = ^FT_ShortArray; + FT_ShortArray = array[0 .. (MaxInt div SizeOf(FT_Short))-1] of FT_Short; (*************************************************************************) (* *) |