diff --git a/packages/fcl-image/src/freetype.pp b/packages/fcl-image/src/freetype.pp index d3bfc8925b..f05b66bce6 100644 --- a/packages/fcl-image/src/freetype.pp +++ b/packages/fcl-image/src/freetype.pp @@ -162,7 +162,14 @@ const sErrDestroying : string = 'finalizing FreeType'; DefaultFontExtention : string = '.ttf'; + + // Standard location for fonts in the Operating System + {$ifdef Darwin} + DefaultSearchPath : string = '/Library/Fonts/'; + {$else} DefaultSearchPath : string = ''; + {$endif} + {$IFDEF MAC} DefaultResolution : integer = 72; {$ELSE} @@ -729,7 +736,10 @@ begin end; end; // 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 if prevx > pos.x then pos.x := prevx; diff --git a/packages/fcl-image/src/freetypeh.pp b/packages/fcl-image/src/freetypeh.pp index 86c70ef80e..1d52c3af1a 100644 --- a/packages/fcl-image/src/freetypeh.pp +++ b/packages/fcl-image/src/freetypeh.pp @@ -15,17 +15,38 @@ {$mode objfpc} unit freetypeh; -{ These are not all the availlable calls from the dll, but only those - I needed for the TStringBitMaps } +{ Note that these are not all the availlable calls from the dll yet. + This unit is used by TStringBitMaps and FTFont } interface const -{$ifdef win32} + +{$packrecords c} + +// Windows +{$ifdef windows} freetypedll = 'freetype-6.dll'; // version 2.1.4 - {$packrecords c} -{$else} - // I don't know what it will be ?? + {$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'; {$endif}