Mercurial > projects > dstep
diff dstep/applicationservices/coregraphics/CGFont.d @ 12:9f0b49a2f64e
Added the ApplicationServices frameworks: ATS, ColorSync and CoreGraphics
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 03 Aug 2009 14:00:21 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/applicationservices/coregraphics/CGFont.d Mon Aug 03 14:00:21 2009 +0200 @@ -0,0 +1,88 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Aug 1, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.applicationservices.coregraphics.CGFont; + +import dstep.corefoundation.CFArray; +import dstep.corefoundation.CFBase; +import dstep.corefoundation.CFData; +import dstep.corefoundation.CFDictionary; + +import dstep.applicationservices.coregraphics.CGBase; +import dstep.applicationservices.coregraphics.CGDataProvider; +import dstep.applicationservices.coregraphics.CGGeometry; + +struct CGFont; + +alias CGFont* CGFontRef; +alias ushort CGFontIndex; +alias ushort CGGlyph; +alias int CGFontPostScriptFormat; + +extern (C) +{ + extern + { + const CFStringRef kCGFontVariationAxisName; + const CFStringRef kCGFontVariationAxisMinValue; + const CFStringRef kCGFontVariationAxisMaxValue; + const CFStringRef kCGFontVariationAxisDefaultValue; + } +} + +enum /*CGFontPostScriptFormat*/ +{ + kCGFontPostScriptFormatType1 = 1, + kCGFontPostScriptFormatType3 = 3, + kCGFontPostScriptFormatType42 = 42 +} + +enum +{ + kCGFontIndexMax = ((1 << 16) - 2), + kCGFontIndexInvalid = ((1 << 16) - 1), + kCGGlyphMax = kCGFontIndexMax +} + +enum +{ + CGGlyphMin = 0, + CGGlyphMax = kCGGlyphMax +} + +extern (C) +{ + uint CGFontGetTypeID (); + CGFontRef CGFontCreateWithPlatformFont (void* platformFontReference); + CGFontRef CGFontCreateWithDataProvider (CGDataProviderRef provider); + CGFontRef CGFontCreateWithFontName (CFStringRef name); + CGFontRef CGFontCreateCopyWithVariations (CGFontRef font, CFDictionaryRef variations); + CGFontRef CGFontRetain (CGFontRef font); + void CGFontRelease (CGFontRef font); + uint CGFontGetNumberOfGlyphs (CGFontRef font); + int CGFontGetUnitsPerEm (CGFontRef font); + CFStringRef CGFontCopyPostScriptName (CGFontRef font); + CFStringRef CGFontCopyFullName (CGFontRef font); + int CGFontGetAscent (CGFontRef font); + int CGFontGetDescent (CGFontRef font); + int CGFontGetLeading (CGFontRef font); + int CGFontGetCapHeight (CGFontRef font); + int CGFontGetXHeight (CGFontRef font); + CGRect CGFontGetFontBBox (CGFontRef font); + CGFloat CGFontGetItalicAngle (CGFontRef font); + CGFloat CGFontGetStemV (CGFontRef font); + CFArrayRef CGFontCopyVariationAxes (CGFontRef font); + CFDictionaryRef CGFontCopyVariations (CGFontRef font); + bool CGFontGetGlyphAdvances (CGFontRef font, CGGlyph* glyphs, uint count, int* advances); + bool CGFontGetGlyphBBoxes (CGFontRef font, CGGlyph* glyphs, uint count, CGRect* bboxes); + ushort CGFontGetGlyphWithGlyphName (CGFontRef font, CFStringRef name); + CFStringRef CGFontCopyGlyphNameForGlyph (CGFontRef font, ushort glyph); + bool CGFontCanCreatePostScriptSubset (CGFontRef font, int format); + CFDataRef CGFontCreatePostScriptSubset (CGFontRef font, CFStringRef subsetName, int format, CGGlyph* glyphs, uint count, ushort[256] encoding); + CFDataRef CGFontCreatePostScriptEncoding (CGFontRef font, ushort[256] encoding); + CFArrayRef CGFontCopyTableTags (CGFontRef font); + CFDataRef CGFontCopyTableForTag (CGFontRef font, uint tag); +} \ No newline at end of file