mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 02:19:22 +01: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';
 | 
			
		||||
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
@ -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}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user