CGFont.h
 1  /* Copyright (c) 2006-2007 Christopher J. W. Lloyd
 2  
 3  Permission is hereby granted, free of charge, to any person obtaining a copy of
 4  this software and associated documentation files (the "Software"), to deal in
 5  the Software without restriction, including without limitation the rights to
 6  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 7  the Software, and to permit persons to whom the Software is furnished to do so,
 8  subject to the following conditions:
 9  
10  The above copyright notice and this permission notice shall be included in all
11  copies or substantial portions of the Software.
12  
13  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
19  
20  #import <CoreGraphics/CGGeometry.h>
21  #import <CoreGraphics/CoreGraphicsExport.h>
22  #import <CoreGraphics/CGDataProvider.h>
23  
24  #include <CoreFoundation/CoreFoundation.h>
25  
26  typedef struct CF_BRIDGED_TYPE(id) O2Font *CGFontRef;
27  
28  typedef uint16_t CGGlyph;
29  
30  CF_IMPLICIT_BRIDGING_ENABLED
31  
32  COREGRAPHICS_EXPORT CFArrayRef CGFontCopyTableTags(CGFontRef font);
33  
34  COREGRAPHICS_EXPORT CGFontRef CGFontCreateWithFontName(CFStringRef name);
35  COREGRAPHICS_EXPORT CGFontRef CGFontRetain(CGFontRef self);
36  COREGRAPHICS_EXPORT void CGFontRelease(CGFontRef self);
37  
38  COREGRAPHICS_EXPORT CFStringRef CGFontCopyFullName(CGFontRef self);
39  COREGRAPHICS_EXPORT int CGFontGetUnitsPerEm(CGFontRef self);
40  COREGRAPHICS_EXPORT int CGFontGetAscent(CGFontRef self);
41  COREGRAPHICS_EXPORT int CGFontGetDescent(CGFontRef self);
42  COREGRAPHICS_EXPORT int CGFontGetLeading(CGFontRef self);
43  COREGRAPHICS_EXPORT int CGFontGetCapHeight(CGFontRef self);
44  COREGRAPHICS_EXPORT int CGFontGetXHeight(CGFontRef self);
45  COREGRAPHICS_EXPORT CGFloat CGFontGetItalicAngle(CGFontRef self);
46  COREGRAPHICS_EXPORT CGFloat CGFontGetStemV(CGFontRef self);
47  COREGRAPHICS_EXPORT CGRect CGFontGetFontBBox(CGFontRef self);
48  
49  COREGRAPHICS_EXPORT size_t CGFontGetNumberOfGlyphs(CGFontRef self);
50  COREGRAPHICS_EXPORT bool CGFontGetGlyphAdvances(CGFontRef self,
51                                                  const CGGlyph *glyphs,
52                                                  size_t count, int *advances);
53  
54  COREGRAPHICS_EXPORT CGGlyph CGFontGetGlyphWithGlyphName(CGFontRef self,
55                                                          CFStringRef name);
56  COREGRAPHICS_EXPORT CFStringRef CGFontCopyGlyphNameForGlyph(CGFontRef self,
57                                                              CGGlyph glyph);
58  
59  COREGRAPHICS_EXPORT CFDataRef CGFontCopyTableForTag(CGFontRef self,
60                                                      uint32_t tag);
61  
62  COREGRAPHICS_EXPORT CGFontRef CGFontCreateWithDataProvider(CGDataProviderRef provider);
63  
64  CF_IMPLICIT_BRIDGING_DISABLED