mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 05:43:51 +02:00
Patch from Dirk Fellenberg to fix freetype font output, see bug #17156. Also other improvements made by me to improve how freetype linking and font searching under Mac OS X
git-svn-id: trunk@15827 -
This commit is contained in:
parent
b7d466e8ab
commit
fdbcb24aef
@ -162,7 +162,14 @@ const
|
|||||||
sErrDestroying : string = 'finalizing FreeType';
|
sErrDestroying : string = 'finalizing FreeType';
|
||||||
|
|
||||||
DefaultFontExtention : string = '.ttf';
|
DefaultFontExtention : string = '.ttf';
|
||||||
|
|
||||||
|
// Standard location for fonts in the Operating System
|
||||||
|
{$ifdef Darwin}
|
||||||
|
DefaultSearchPath : string = '/Library/Fonts/';
|
||||||
|
{$else}
|
||||||
DefaultSearchPath : string = '';
|
DefaultSearchPath : string = '';
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{$IFDEF MAC}
|
{$IFDEF MAC}
|
||||||
DefaultResolution : integer = 72;
|
DefaultResolution : integer = 72;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -729,7 +736,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
// place position for next glyph
|
// place position for next glyph
|
||||||
pos.x := pos.x + (gl^.advance.x shr 10);
|
// The previous code in this place used shr 10, which
|
||||||
|
// produces wrongly spaced text and looks very ugly
|
||||||
|
// for more information see: http://bugs.freepascal.org/view.php?id=17156
|
||||||
|
pos.x := pos.x + (gl^.advance.x shr 11);
|
||||||
// pos.y := pos.y + (gl^.advance.y shr 6); // for angled texts also
|
// pos.y := pos.y + (gl^.advance.y shr 6); // for angled texts also
|
||||||
if prevx > pos.x then
|
if prevx > pos.x then
|
||||||
pos.x := prevx;
|
pos.x := prevx;
|
||||||
|
@ -15,17 +15,38 @@
|
|||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
unit freetypeh;
|
unit freetypeh;
|
||||||
|
|
||||||
{ These are not all the availlable calls from the dll, but only those
|
{ Note that these are not all the availlable calls from the dll yet.
|
||||||
I needed for the TStringBitMaps }
|
This unit is used by TStringBitMaps and FTFont }
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
const
|
const
|
||||||
{$ifdef win32}
|
|
||||||
freetypedll = 'freetype-6.dll'; // version 2.1.4
|
|
||||||
{$packrecords c}
|
{$packrecords c}
|
||||||
{$else}
|
|
||||||
// I don't know what it will be ??
|
// Windows
|
||||||
|
{$ifdef windows}
|
||||||
|
freetypedll = 'freetype-6.dll'; // version 2.1.4
|
||||||
|
{$define ft_found_platform}
|
||||||
|
{$endif}
|
||||||
|
// Mac OS X
|
||||||
|
{$ifdef darwin}
|
||||||
|
freetypedll = 'libfreetype'; // Doesn't seam to matter much.
|
||||||
|
{$linklib freetype} // This one is the important part,
|
||||||
|
// but you also need to pass to fpc
|
||||||
|
// the following command:
|
||||||
|
// -k-L/usr/X11/lib
|
||||||
|
// or another place where it can find
|
||||||
|
// libfreetype.dylib
|
||||||
|
{$define ft_found_platform}
|
||||||
|
{$endif}
|
||||||
|
// LINUX
|
||||||
|
{$if defined(UNIX) and not defined(darwin)}
|
||||||
|
freetypedll = 'freetype';
|
||||||
|
{$define ft_found_platform}
|
||||||
|
{$endif}
|
||||||
|
// Other platforms
|
||||||
|
{$ifndef ft_found_platform}
|
||||||
freetypedll = 'freetype';
|
freetypedll = 'freetype';
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user