home *** CD-ROM | disk | FTP | other *** search
/ CLIX - Fazer Clix Custa Nix / CLIX-CD.cdr / mac / lib / Mac / Fonts.xs < prev    next >
Text File  |  1998-04-13  |  3KB  |  160 lines

  1. /* $Header: /home/neeri/MacCVS/MacPerl/perl/ext/Mac/Fonts/Fonts.xs,v 1.2 1997/11/18 00:52:23 neeri Exp $
  2.  *
  3.  *    Copyright (c) 1996 Matthias Neeracher
  4.  *
  5.  *    You may distribute under the terms of the Perl Artistic License,
  6.  *    as specified in the README file.
  7.  *
  8.  * $Log: Fonts.xs,v $
  9.  * Revision 1.2  1997/11/18 00:52:23  neeri
  10.  * MacPerl 5.1.5
  11.  *
  12.  * Revision 1.1  1997/04/07 20:49:41  neeri
  13.  * Synchronized with MacPerl 5.1.4a1
  14.  *
  15.  */
  16.  
  17. #define MAC_CONTEXT
  18.  
  19. #include "EXTERN.h"
  20. #include "perl.h"
  21. #include "XSUB.h"
  22. #include <Types.h>
  23. #include <Memory.h>
  24. #include <Fonts.h>
  25.  
  26. static Point    sUnityPoint = {1, 1};
  27.  
  28. MODULE = Mac::Fonts PACKAGE = Mac::Fonts
  29.  
  30. =head2 Functions
  31.  
  32. =over 4
  33.  
  34. =item GetFontName FAMILY
  35.  
  36. Returns the name of a numbered font
  37.  
  38. =cut
  39. Str255
  40. GetFontName(familyID)
  41.     short   familyID
  42.     CODE:
  43.     GetFontName(familyID, RETVAL);
  44.     OUTPUT:
  45.     RETVAL
  46.  
  47. =item GetFNum NAME
  48.  
  49. Returns the number of a named font.
  50.  
  51. =cut
  52. short
  53. GetFNum(name)
  54.     Str255  name
  55.     CODE:
  56.     GetFNum(name, &RETVAL);
  57.     OUTPUT:
  58.     RETVAL
  59.  
  60. =item RealFont FONTNUM, SIZE
  61.  
  62. Returns whether a font with a certain ID and size really exists or has to be
  63. interpolated.
  64.  
  65. =cut
  66. Boolean
  67. RealFont(fontNum, size)
  68.     short   fontNum
  69.     short   size
  70.  
  71. =item SetFScaleDisable DISABLE
  72.  
  73. Enable or disable scaling of fonts.
  74.  
  75. =cut
  76. void
  77. SetFScaleDisable(fscaleDisable)
  78.     Boolean     fscaleDisable
  79.  
  80. =item SetFractEnable ENABLE
  81.  
  82. Enable or disable fractional widths.
  83.  
  84. =cut
  85. void
  86. SetFractEnable(fractEnable)
  87.     Boolean     fractEnable
  88.  
  89. =item GetDefFontSize()
  90.  
  91. Get the default size of a font.
  92.  
  93. =cut
  94. short
  95. GetDefFontSize()
  96.         
  97. =item IsOutline NUMER [, DENOM]
  98.  
  99. Returns whether a font is an outline font.
  100.  
  101. =cut
  102. Boolean
  103. IsOutline(numer, denom=sUnityPoint)
  104.     Point numer
  105.     Point denom
  106.  
  107. =item SetOutlinePreferred ENABLE
  108.  
  109. Set if an outline font should be chosen even if a bitmap font is available.
  110.  
  111. =cut
  112. void
  113. SetOutlinePreferred(outlinePreferred)
  114.     Boolean     outlinePreferred
  115.  
  116. =item GetOutlinePreferred
  117.  
  118. Returns the state of the outline flag.
  119.  
  120. =cut
  121. Boolean
  122. GetOutlinePreferred()
  123.  
  124. =item SetPreserveGlyph ENABLE
  125.  
  126. Set if glyphs are allowed to exceed the ascent and descent of the font.
  127.  
  128. =cut
  129. void
  130. SetPreserveGlyph(preserveGlyph)
  131.     Boolean     preserveGlyph
  132.  
  133. =item GetPreserveGlyph()
  134.  
  135. Get the value of the flag set with C<SetPreserveGlyph>.
  136.  
  137. =cut
  138. Boolean
  139. GetPreserveGlyph()
  140.  
  141. =item GetSysFont()
  142.  
  143. Get the ID of the system font.
  144.  
  145. =cut
  146. short
  147. GetSysFont()
  148.  
  149. =item GetAppFont()
  150.  
  151. Get the ID of the default application font.
  152.  
  153. =cut
  154. short
  155. GetAppFont()
  156.  
  157. =back
  158.  
  159. =cut
  160.