- removed dependancy of KGContext_gdi/KGContext_builtin_gdi on KTFont

- added encoding info to KGGraphicsState and KGFont
- moved CoreText stuff to its own project
This commit is contained in:
Christopher Lloyd 2009-07-02 19:28:33 +00:00
parent 3524019811
commit 3e5eba15a1
27 changed files with 1204 additions and 434 deletions

View File

@ -3727,6 +3727,7 @@
6E2B53240976075200DA0954 /* Classes */ = {
isa = PBXGroup;
children = (
FEB0822A0FFB1F2800C27509 /* CoreText */,
FEA317C10FD5893300F480D4 /* NSRaise.h */,
6E2B53FC0976075200DA0954 /* AppKit.h */,
6E2B53FA0976075200DA0954 /* AppKitExport.h */,
@ -4186,7 +4187,6 @@
FEAED79C0FD6C96E0043F915 /* KGDataConsumer.h */,
FEAED79D0FD6C96E0043F915 /* KGDataConsumer.m */,
FEAED7980FD6C95D0043F915 /* CGDataConsumer.m */,
FE337FC90EE77A6C00D4A751 /* CTFont.m */,
FE25FF600EE58712009C91B1 /* KGFont.h */,
FE25FF610EE58712009C91B1 /* KGFont.m */,
FEF9CB780E13EB8E003502ED /* KGColorSpace+PDF.h */,
@ -4253,8 +4253,6 @@
FE64B8AA0B81239D007EE513 /* KGContext.m */,
FE64B8AB0B81239D007EE513 /* KGDataProvider.h */,
FE64B8AC0B81239D007EE513 /* KGDataProvider.m */,
FE89AF470C33679100CD21FB /* KTFont.h */,
FE89AF480C33679100CD21FB /* KTFont.m */,
FE64B8AD0B81239D007EE513 /* KGFunction.h */,
FE64B8AE0B81239D007EE513 /* KGFunction.m */,
6E2B55D10976075300DA0954 /* KGGraphicsState.h */,
@ -4758,6 +4756,17 @@
path = NSKeyValueBinding;
sourceTree = "<group>";
};
FEB0822A0FFB1F2800C27509 /* CoreText */ = {
isa = PBXGroup;
children = (
FE89AF470C33679100CD21FB /* KTFont.h */,
FE89AF480C33679100CD21FB /* KTFont.m */,
FE337FC90EE77A6C00D4A751 /* CTFont.m */,
);
name = CoreText;
path = ../CoreText;
sourceTree = "<group>";
};
FECAF4C90DB710EE00BA2A8E /* Products */ = {
isa = PBXGroup;
children = (
@ -7931,6 +7940,7 @@
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/CoreGraphics.subproj\"";
OTHER_CFLAGS = (
"-DAPPKIT_INSIDE_BUILD",
"-DCORETEXT_INSIDE_BUILD",
"-DCOREGRAPHICS_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
@ -7993,6 +8003,7 @@
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/CoreGraphics.subproj\"";
OTHER_CFLAGS = (
"-DAPPKIT_INSIDE_BUILD",
"-DCORETEXT_INSIDE_BUILD",
"-DCOREGRAPHICS_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-DLINUX",
@ -8044,6 +8055,7 @@
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/CoreGraphics.subproj\"";
OTHER_CFLAGS = (
"-DAPPKIT_INSIDE_BUILD",
"-DCORETEXT_INSIDE_BUILD",
"-DCOREGRAPHICS_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-DLINUX",
@ -8092,6 +8104,7 @@
LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/CoreGraphics.subproj\"";
OTHER_CFLAGS = (
"-DAPPKIT_INSIDE_BUILD",
"-DCORETEXT_INSIDE_BUILD",
"-DCOREGRAPHICS_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-DDARWIN",
@ -8147,6 +8160,7 @@
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/CoreGraphics.subproj\"";
OTHER_CFLAGS = (
"-DAPPKIT_INSIDE_BUILD",
"-DCORETEXT_INSIDE_BUILD",
"-DCOREGRAPHICS_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-DDARWIN",
@ -8193,6 +8207,7 @@
INSTALL_PATH = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
OTHER_CFLAGS = (
"-DAPPKIT_INSIDE_BUILD",
"-DCORETEXT_INSIDE_BUILD",
"-DCOREGRAPHICS_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",

View File

@ -5,7 +5,7 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "../../CoreGraphics/KGContext_builtin.h"
#import <CoreGraphics/KGContext_builtin.h>
#import <windows.h>
@class Win32Font,KGDeviceContext_gdi;

View File

@ -9,9 +9,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <CoreGraphics/KGGraphicsState.h>
#import "KGSurface_DIBSection.h"
#import "KGDeviceContext_gdi.h"
#import "KTFont_gdi.h"
#import "../../CoreGraphics/KGColorSpace.h"
#import "../../CoreGraphics/KGColor.h"
#import "KGFont_gdi.h"
#import <CoreGraphics/KGColorSpace.h>
#import <CoreGraphics/KGColor.h>
#import <AppKit/Win32Font.h>
@implementation KGContext_builtin_gdi
@ -61,45 +61,49 @@ static inline BOOL transformIsFlipped(CGAffineTransform matrix){
-(void)showGlyphs:(const CGGlyph *)glyphs count:(unsigned)count {
CGAffineTransform transformToDevice=[self userSpaceToDeviceSpaceTransform];
CGAffineTransform Trm=CGAffineTransformConcat([self currentState]->_textTransform,transformToDevice);
KGGraphicsState *gState=[self currentState];
CGAffineTransform Trm=CGAffineTransformConcat(gState->_textTransform,transformToDevice);
NSPoint point=CGPointApplyAffineTransform(NSMakePoint(0,0),Trm);
SetTextColor(_dc,COLORREFFromColor([self fillColor]));
ExtTextOutW(_dc,point.x,point.y,ETO_GLYPH_INDEX,NULL,(void *)glyphs,count,NULL);
KTFont_gdi *ktFont=[[self currentState] fontState];
NSSize advancement=[ktFont advancementForNominalGlyphs:glyphs count:count];
ExtTextOutW(_dc,lroundf(point.x),lroundf(point.y),ETO_GLYPH_INDEX,NULL,(void *)glyphs,count,NULL);
[self currentState]->_textTransform.tx+=advancement.width;
[self currentState]->_textTransform.ty+=advancement.height;
KGFont *font=[gState font];
int i,advances[count];
CGFloat unitsPerEm=CGFontGetUnitsPerEm(font);
O2FontGetGlyphAdvances(font,glyphs,count,advances);
CGFloat total=0;
for(i=0;i<count;i++)
total+=advances[i];
total=(total/CGFontGetUnitsPerEm(font))*gState->_pointSize;
[self currentState]->_textTransform.tx+=total;
[self currentState]->_textTransform.ty+=0;
}
-(void)showText:(const char *)text length:(unsigned)length {
unichar unicode[length];
CGGlyph glyphs[length];
int i;
CGGlyph *encoding=[[self currentState] glyphTableForTextEncoding];
CGGlyph glyphs[length];
int i;
// FIX, encoding
for(i=0;i<length;i++)
unicode[i]=text[i];
glyphs[i]=encoding[(uint8_t)text[i]];
[[[self currentState] fontState] getGlyphs:glyphs forCharacters:unicode length:length];
[self showGlyphs:glyphs count:length];
}
-(void)establishFontStateInDevice {
KTFont *font=[[self currentState] fontState];
KGGraphicsState *gState=[self currentState];
[_gdiFont release];
_gdiFont=[[[self currentState] fontState] createGDIFontSelectedInDC:_dc];
_gdiFont=[(KGFont_gdi *)[gState font] createGDIFontSelectedInDC:_dc pointSize:[gState pointSize]];
}
-(void)establishFontState {
KGGraphicsState *state=[self currentState];
KTFont *fontState=[[KTFont_gdi alloc] initWithFont:[state font] size:[state pointSize]];
[state setFontState:fontState];
[fontState release];
[self establishFontStateInDevice];
}

View File

@ -20,8 +20,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <CoreGraphics/KGColorSpace.h>
#import <CoreGraphics/KGShading.h>
#import <CoreGraphics/KGFunction.h>
#import "KTFont_gdi.h"
#import "../../CoreGraphics/KGImage.h"
#import "KGFont_gdi.h"
#import <CoreGraphics/KGImage.h>
#import <CoreGraphics/KGClipPhase.h>
#import <AppKit/Win32Font.h>
#import <AppKit/NSRaise.h>
@ -190,17 +190,12 @@ static RECT NSRectToRECT(NSRect rect) {
}
-(void)establishFontStateInDevice {
KTFont *font=[[self currentState] fontState];
KGGraphicsState *gState=[self currentState];
[_gdiFont release];
_gdiFont=[[[self currentState] fontState] createGDIFontSelectedInDC:_dc];
_gdiFont=[(KGFont_gdi *)[gState font] createGDIFontSelectedInDC:_dc pointSize:[gState pointSize]];
}
-(void)establishFontState {
KGGraphicsState *state=[self currentState];
KTFont *fontState=[[KTFont_gdi alloc] initWithFont:[state font] size:[state pointSize]];
[state setFontState:fontState];
[fontState release];
[self establishFontStateInDevice];
}
@ -342,29 +337,39 @@ static RECT NSRectToRECT(NSRect rect) {
-(void)showGlyphs:(const CGGlyph *)glyphs count:(unsigned)count {
CGAffineTransform transformToDevice=[self userSpaceToDeviceSpaceTransform];
CGAffineTransform Trm=CGAffineTransformConcat([self currentState]->_textTransform,transformToDevice);
KGGraphicsState *gState=[self currentState];
CGAffineTransform Trm=CGAffineTransformConcat(gState->_textTransform,transformToDevice);
NSPoint point=CGPointApplyAffineTransform(NSMakePoint(0,0),Trm);
SetTextColor(_dc,COLORREFFromColor([self fillColor]));
ExtTextOutW(_dc,lroundf(point.x),lroundf(point.y),ETO_GLYPH_INDEX,NULL,(void *)glyphs,count,NULL);
KTFont_gdi *ktFont=[[self currentState] fontState];
NSSize advancement=[ktFont advancementForNominalGlyphs:glyphs count:count];
KGFont *font=[gState font];
int i,advances[count];
CGFloat unitsPerEm=CGFontGetUnitsPerEm(font);
[self currentState]->_textTransform.tx+=advancement.width;
[self currentState]->_textTransform.ty+=advancement.height;
O2FontGetGlyphAdvances(font,glyphs,count,advances);
CGFloat total=0;
for(i=0;i<count;i++)
total+=advances[i];
total=(total/CGFontGetUnitsPerEm(font))*gState->_pointSize;
[self currentState]->_textTransform.tx+=total;
[self currentState]->_textTransform.ty+=0;
}
-(void)showText:(const char *)text length:(unsigned)length {
unichar unicode[length];
CGGlyph glyphs[length];
int i;
CGGlyph *encoding=[[self currentState] glyphTableForTextEncoding];
CGGlyph glyphs[length];
int i;
// FIX, encoding
for(i=0;i<length;i++)
unicode[i]=text[i];
glyphs[i]=encoding[(uint8_t)text[i]];
[[[self currentState] fontState] getGlyphs:glyphs forCharacters:unicode length:length];
[self showGlyphs:glyphs count:length];
}

View File

@ -1,7 +1,13 @@
#import <CoreGraphics/KGFont.h>
#import <windows.h>
@class Win32Font;
@interface KGFont_gdi : KGFont {
BOOL _useMacMetrics;
unichar *_glyphsToCharacters;
}
-(Win32Font *)createGDIFontSelectedInDC:(HDC)dc pointSize:(CGFloat)pointSize;
@end

View File

@ -3,6 +3,7 @@
#define _WIN32_WINNT 0x0501
#import <windows.h>
#import <Foundation/NSString_win32.h>
#import "Win32Font.h"
@implementation KGFont(GDI)
@ -94,11 +95,13 @@ static HFONT Win32FontHandleWithName(NSString *name,int unitsPerEm){
_unitsPerEm=ttMetrics->otmEMSquare;
if([name isEqualToString:@"Marlett"]){
_useMacMetrics=NO;
_ascent=ttMetrics->otmAscent;
_descent=ttMetrics->otmDescent;
_leading=ttMetrics->otmLineGap;
}
else {
_useMacMetrics=YES;
_ascent=ttMetrics->otmMacAscent;
_descent=ttMetrics->otmMacDescent;
_leading=ttMetrics->otmMacLineGap;
@ -169,7 +172,6 @@ static HFONT Win32FontHandleWithName(NSString *name,int unitsPerEm){
for(i=max;--i>=0;){
CGGlyph glyph=glyphs[i];
if(glyph<_numberOfGlyphs)
_advances[glyph]=abc[i].abcfA+abc[i].abcfB+abc[i].abcfC;
}
@ -179,6 +181,23 @@ static HFONT Win32FontHandleWithName(NSString *name,int unitsPerEm){
ReleaseDC(NULL,dc);
}
-(Win32Font *)createGDIFontSelectedInDC:(HDC)dc pointSize:(CGFloat)pointSize {
if(_useMacMetrics){
if (pointSize <= 10.0)
pointSize=pointSize;
else if (pointSize < 20.0)
pointSize=pointSize/(1.0 + 0.2*sqrtf(0.0390625*(pointSize - 10.0)));
else
pointSize=pointSize/1.125;
}
int height=(pointSize*GetDeviceCaps(dc,LOGPIXELSY))/72.0;
Win32Font *result=[[Win32Font alloc] initWithName:_name height:height antialias:NO];
SelectObject(dc,[result fontHandle]);
return result;
}
// These are only used for PDF generation until we get PS glyph names working
// They are both temporary and inaccurate
@ -230,21 +249,25 @@ static HFONT Win32FontHandleWithName(NSString *name,int unitsPerEm){
}
}
-(void)getMacRomanEncoding:(CGGlyph[256])encoding {
HDC dc=GetDC(NULL);
unichar characters[256];
HANDLE library=LoadLibrary("GDI32");
FARPROC getGlyphIndices=GetProcAddress(library,"GetGlyphIndicesW");
int i;
-(CGGlyph *)MacRomanEncoding {
if(_MacRomanEncoding==NULL){
HDC dc=GetDC(NULL);
unichar characters[256];
HANDLE library=LoadLibrary("GDI32");
FARPROC getGlyphIndices=GetProcAddress(library,"GetGlyphIndicesW");
int i;
for(i=0;i<256;i++)
characters[i]=i;
_MacRomanEncoding=NSZoneMalloc(NULL,sizeof(CGGlyph)*256);
for(i=0;i<256;i++)
characters[i]=i;
HFONT font=Win32FontHandleWithName(_name,_unitsPerEm);
SelectObject(dc,font);
getGlyphIndices(dc,characters,256,encoding,0);
DeleteObject(font);
ReleaseDC(NULL,dc);
HFONT font=Win32FontHandleWithName(_name,_unitsPerEm);
SelectObject(dc,font);
getGlyphIndices(dc,characters,256,_MacRomanEncoding,0);
DeleteObject(font);
ReleaseDC(NULL,dc);
}
return _MacRomanEncoding;
}
@end

View File

@ -5,7 +5,7 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "../../CoreGraphics/KGSurface.h"
#import <CoreGraphics/KGSurface.h>
@class KGDeviceContext_gdi,KGDeviceContext_gdiDIBSection;

View File

@ -3,6 +3,7 @@
#import "KGContext_gdi.h"
#import "Win32Display.h"
#import "Win32Font.h"
#import "KGFont_gdi.h"
#import <CoreGraphics/KGMutablePath.h>
#import <AppKit/NSRaise.h>
@ -93,7 +94,7 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self,CGGlyph glyph){
return;
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[self createGDIFontSelectedInDC:dc];
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
NSRange range=NSMakeRange(0,MAXUNICHAR);
unichar characters[range.length];
unsigned short glyphs[range.length];
@ -158,7 +159,7 @@ static inline CGGlyphMetrics *glyphInfoForGlyph(KTFont_gdi *self,CGGlyph glyph){
-(void)fetchGlyphKerning {
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[self createGDIFontSelectedInDC:dc];
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
int i,numberOfPairs=GetKerningPairs(dc,0,NULL);
KERNINGPAIR pairs[numberOfPairs];
@ -221,7 +222,7 @@ static inline CGGlyphMetrics *fetchGlyphInfoIfNeeded(KTFont_gdi *self,CGGlyph gl
-(void)fetchAdvancementsForGlyph:(CGGlyph)glyph {
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[self createGDIFontSelectedInDC:dc];
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
ABCFLOAT *abc;
int i,max;
@ -280,7 +281,7 @@ static inline CGGlyphMetrics *fetchGlyphAdvancementIfNeeded(KTFont_gdi *self,CGG
-(void)fetchMetrics {
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[self createGDIFontSelectedInDC:dc];
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
TEXTMETRIC gdiMetrics;
GetTextMetrics(dc,&gdiMetrics);
@ -589,7 +590,7 @@ NSLog(@"name=%@,size=%f",[NSString stringWithCString:fontData. elfLogFont.lfFace
-(KGPath *)createPathForGlyph:(CGGlyph)glyph transform:(CGAffineTransform *)xform {
KGMutablePath *result=[[KGMutablePath alloc] init];
HDC dc=GetDC(NULL);
Win32Font *gdiFont=[self createGDIFontSelectedInDC:dc];
Win32Font *gdiFont=[(KGFont_gdi *)_font createGDIFontSelectedInDC:dc pointSize:_size];
int size=GetOutlineTextMetricsA(dc,0,NULL);
if(size<=0){

View File

@ -7,4 +7,4 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CoreGraphics.h>
#import <CoreGraphics/CoreText.h>
#import <CoreText/CoreText.h>

View File

@ -117,6 +117,41 @@
remoteGlobalIDString = FED70FB70C3C09C7000CBE5B;
remoteInfo = "Foundation-Darwin-ppc";
};
FECF921E0FFB222D007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216 /* CoreText.framework */;
remoteInfo = CoreText;
};
FECF92530FFB2A2B007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FECF923F0FFB29FF007AECF1 /* CoreGraphics.framework */;
remoteInfo = "CoreText-Linux-i386";
};
FECF92550FFB2A2B007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FECF924F0FFB2A0D007AECF1 /* CoreGraphics.framework */;
remoteInfo = "CoreText-Darwin-i386";
};
FECF92930FFB2D44007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216 /* CoreText-Windows-i386 */;
remoteInfo = "CoreText-Windows-i386";
};
FECF92950FFB2D4B007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = FECF92310FFB29FF007AECF1 /* CoreText-Linux-i386 */;
remoteInfo = "CoreText-Linux-i386";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@ -129,6 +164,7 @@
FE32179C0BB41C65004F000A /* ApplicationServices.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ApplicationServices.h; sourceTree = "<group>"; };
FEC11BB10FD4B86500082282 /* CoreGraphics.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CoreGraphics.xcodeproj; path = ../CoreGraphics/CoreGraphics.xcodeproj; sourceTree = SOURCE_ROOT; };
FECAF5010DB7119B00BA2A8E /* Foundation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Foundation.xcodeproj; path = ../Foundation/Foundation.xcodeproj; sourceTree = SOURCE_ROOT; };
FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CoreText.xcodeproj; path = ../CoreText/CoreText.xcodeproj; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -169,6 +205,7 @@
0867D691FE84028FC02AAC07 /* ApplicationServices */ = {
isa = PBXGroup;
children = (
FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */,
FEC11BB10FD4B86500082282 /* CoreGraphics.xcodeproj */,
FE32179C0BB41C65004F000A /* ApplicationServices.h */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
@ -244,6 +281,16 @@
name = Products;
sourceTree = "<group>";
};
FECF921B0FFB222D007AECF1 /* Products */ = {
isa = PBXGroup;
children = (
FECF921F0FFB222D007AECF1 /* CoreText.framework */,
FECF92540FFB2A2B007AECF1 /* CoreGraphics.framework */,
FECF92560FFB2A2B007AECF1 /* CoreGraphics.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@ -287,6 +334,7 @@
C88977360EA0C0CD00D0A0A2 /* PBXBuildRule */,
);
dependencies = (
FECF92960FFB2D4B007AECF1 /* PBXTargetDependency */,
);
name = "ApplicationServices-Linux-i386";
productInstallPath = "$(HOME)/Library/Frameworks";
@ -328,6 +376,7 @@
);
dependencies = (
FEC11BB80FD4B88800082282 /* PBXTargetDependency */,
FECF92940FFB2D44007AECF1 /* PBXTargetDependency */,
);
name = "ApplicationServices-Windows-i386";
productInstallPath = "$(HOME)/Library/Frameworks";
@ -351,6 +400,10 @@
ProductGroup = FEC11BB20FD4B86500082282 /* Products */;
ProjectRef = FEC11BB10FD4B86500082282 /* CoreGraphics.xcodeproj */;
},
{
ProductGroup = FECF921B0FFB222D007AECF1 /* Products */;
ProjectRef = FECF921A0FFB222D007AECF1 /* CoreText.xcodeproj */;
},
{
ProductGroup = FECAF5020DB7119B00BA2A8E /* Products */;
ProjectRef = FECAF5010DB7119B00BA2A8E /* Foundation.xcodeproj */;
@ -436,6 +489,27 @@
remoteRef = FECAF5120DB7119B00BA2A8E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FECF921F0FFB222D007AECF1 /* CoreText.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CoreText.framework;
remoteRef = FECF921E0FFB222D007AECF1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FECF92540FFB2A2B007AECF1 /* CoreGraphics.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CoreGraphics.framework;
remoteRef = FECF92530FFB2A2B007AECF1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FECF92560FFB2A2B007AECF1 /* CoreGraphics.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CoreGraphics.framework;
remoteRef = FECF92550FFB2A2B007AECF1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@ -492,6 +566,16 @@
name = "CoreGraphics-Windows-i386";
targetProxy = FEC11BB70FD4B88800082282 /* PBXContainerItemProxy */;
};
FECF92940FFB2D44007AECF1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "CoreText-Windows-i386";
targetProxy = FECF92930FFB2D44007AECF1 /* PBXContainerItemProxy */;
};
FECF92960FFB2D4B007AECF1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "CoreText-Linux-i386";
targetProxy = FECF92950FFB2D4B007AECF1 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */

View File

@ -27,7 +27,8 @@ typedef KGContext *CGContextRef;
@class NSDictionary;
typedef enum {
kCGEncodingFontSpecific
kCGEncodingFontSpecific,
kCGEncodingMacRoman,
} CGTextEncoding;
typedef enum {

View File

@ -1,39 +0,0 @@
/* Copyright (c) 2007 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <Foundation/NSObject.h>
#import <CoreGraphics/CoreGraphicsExport.h>
#import <CoreGraphics/CGAffineTransform.h>
#import <CoreGraphics/CGFont.h>
#import <CoreGraphics/CGPath.h>
@class KTFont;
typedef KTFont *CTFontRef;
typedef enum {
kCTFontMenuTitleFontType,
kCTFontMenuItemFontType,
} CTFontUIFontType;
COREGRAPHICS_EXPORT CTFontRef CTFontCreateWithGraphicsFont(CGFontRef cgFont,CGFloat size,CGAffineTransform *xform,id attributes);
COREGRAPHICS_EXPORT CTFontRef CTFontCreateUIFontForLanguage(CTFontUIFontType uiFontType,CGFloat size,NSString *language);
COREGRAPHICS_EXPORT NSString *CTFontCopyFullName(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetSize(CTFontRef self);
COREGRAPHICS_EXPORT size_t CTFontGetGlyphCount(CTFontRef self);
COREGRAPHICS_EXPORT BOOL CTFontGetGlyphsForCharacters(CTFontRef self,const unichar *characters,CGGlyph *glyphs,size_t count);
COREGRAPHICS_EXPORT CGRect CTFontGetBoundingBox(CTFontRef self);
COREGRAPHICS_EXPORT void CTFontGetAdvancesForGlyphs(CTFontRef self,int orientation,const CGGlyph *glyphs,CGSize *advances,size_t count);
COREGRAPHICS_EXPORT CGFloat CTFontGetUnderlinePosition(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetUnderlineThickness(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetAscent(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetDescent(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetLeading(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetSlantAngle(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetXHeight(CTFontRef self);
COREGRAPHICS_EXPORT CGFloat CTFontGetCapHeight(CTFontRef self);
COREGRAPHICS_EXPORT CGPathRef CTFontCreatePathForGlyph(CTFontRef self,CGGlyph glyph,CGAffineTransform *xform);

View File

@ -91,13 +91,10 @@
FE6F7B4B0FD554A800C3244F /* KGShading.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AD70FD4B4D600082282 /* KGShading.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B4C0FD554A800C3244F /* KGSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AD90FD4B4D600082282 /* KGSurface.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B4D0FD554A800C3244F /* KGzlib.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11ADB0FD4B4D600082282 /* KGzlib.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B4F0FD554A800C3244F /* KTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11ADF0FD4B4D600082282 /* KTFont.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B500FD554A800C3244F /* NSTIFFImageFileDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE10FD4B4D600082282 /* NSTIFFImageFileDirectory.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B510FD554A800C3244F /* NSTIFFReader.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE30FD4B4D600082282 /* NSTIFFReader.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B520FD554A800C3244F /* VGmath.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE50FD4B4D600082282 /* VGmath.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B530FD554A800C3244F /* VGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE60FD4B4D600082282 /* VGPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7B540FD554A800C3244F /* CoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11C030FD4C2BB00082282 /* CoreText.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE6F7B550FD554A800C3244F /* CTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11C040FD4C2BB00082282 /* CTFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE6F7B580FD554A800C3244F /* CGAffineTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A390FD4B4D600082282 /* CGAffineTransform.m */; };
FE6F7B590FD554A800C3244F /* CGBitmapContext.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A3B0FD4B4D600082282 /* CGBitmapContext.m */; };
FE6F7B5A0FD554A800C3244F /* CGColor.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A3D0FD4B4D600082282 /* CGColor.m */; };
@ -118,7 +115,6 @@
FE6F7B690FD554A800C3244F /* CGPDFPage.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5B0FD4B4D600082282 /* CGPDFPage.m */; };
FE6F7B6A0FD554A800C3244F /* CGShading.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5D0FD4B4D600082282 /* CGShading.m */; };
FE6F7B6B0FD554A800C3244F /* CGWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5F0FD4B4D600082282 /* CGWindow.m */; };
FE6F7B6C0FD554A800C3244F /* CTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A620FD4B4D600082282 /* CTFont.m */; };
FE6F7B6D0FD554A800C3244F /* gif_lib.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A640FD4B4D600082282 /* gif_lib.m */; };
FE6F7B6E0FD554A800C3244F /* KGBitmapContext.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A660FD4B4D600082282 /* KGBitmapContext.m */; };
FE6F7B6F0FD554A800C3244F /* KGClipPhase.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A690FD4B4D600082282 /* KGClipPhase.m */; };
@ -179,7 +175,6 @@
FE6F7BA60FD554A800C3244F /* KGShading.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AD80FD4B4D600082282 /* KGShading.m */; };
FE6F7BA70FD554A800C3244F /* KGSurface.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11ADA0FD4B4D600082282 /* KGSurface.m */; };
FE6F7BA80FD554A800C3244F /* KGzlib.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11ADC0FD4B4D600082282 /* KGzlib.m */; };
FE6F7BAA0FD554A800C3244F /* KTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE00FD4B4D600082282 /* KTFont.m */; };
FE6F7BAB0FD554A800C3244F /* NSTIFFImageFileDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE20FD4B4D600082282 /* NSTIFFImageFileDirectory.m */; };
FE6F7BAC0FD554A800C3244F /* NSTIFFReader.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE40FD4B4D600082282 /* NSTIFFReader.m */; };
FE6F7BAD0FD554A800C3244F /* VGPath.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE70FD4B4D600082282 /* VGPath.m */; };
@ -268,13 +263,10 @@
FE6F7C300FD55FA300C3244F /* KGShading.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AD70FD4B4D600082282 /* KGShading.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C310FD55FA300C3244F /* KGSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AD90FD4B4D600082282 /* KGSurface.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C320FD55FA300C3244F /* KGzlib.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11ADB0FD4B4D600082282 /* KGzlib.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C340FD55FA300C3244F /* KTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11ADF0FD4B4D600082282 /* KTFont.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C350FD55FA300C3244F /* NSTIFFImageFileDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE10FD4B4D600082282 /* NSTIFFImageFileDirectory.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C360FD55FA300C3244F /* NSTIFFReader.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE30FD4B4D600082282 /* NSTIFFReader.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C370FD55FA300C3244F /* VGmath.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE50FD4B4D600082282 /* VGmath.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C380FD55FA300C3244F /* VGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE60FD4B4D600082282 /* VGPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
FE6F7C390FD55FA300C3244F /* CoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11C030FD4C2BB00082282 /* CoreText.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE6F7C3A0FD55FA300C3244F /* CTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11C040FD4C2BB00082282 /* CTFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE6F7C3D0FD55FA300C3244F /* CGAffineTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A390FD4B4D600082282 /* CGAffineTransform.m */; };
FE6F7C3E0FD55FA300C3244F /* CGBitmapContext.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A3B0FD4B4D600082282 /* CGBitmapContext.m */; };
FE6F7C3F0FD55FA300C3244F /* CGColor.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A3D0FD4B4D600082282 /* CGColor.m */; };
@ -295,7 +287,6 @@
FE6F7C4E0FD55FA300C3244F /* CGPDFPage.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5B0FD4B4D600082282 /* CGPDFPage.m */; };
FE6F7C4F0FD55FA300C3244F /* CGShading.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5D0FD4B4D600082282 /* CGShading.m */; };
FE6F7C500FD55FA300C3244F /* CGWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5F0FD4B4D600082282 /* CGWindow.m */; };
FE6F7C510FD55FA300C3244F /* CTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A620FD4B4D600082282 /* CTFont.m */; };
FE6F7C520FD55FA300C3244F /* gif_lib.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A640FD4B4D600082282 /* gif_lib.m */; };
FE6F7C530FD55FA300C3244F /* KGBitmapContext.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A660FD4B4D600082282 /* KGBitmapContext.m */; };
FE6F7C540FD55FA300C3244F /* KGClipPhase.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A690FD4B4D600082282 /* KGClipPhase.m */; };
@ -356,7 +347,6 @@
FE6F7C8B0FD55FA300C3244F /* KGShading.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AD80FD4B4D600082282 /* KGShading.m */; };
FE6F7C8C0FD55FA300C3244F /* KGSurface.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11ADA0FD4B4D600082282 /* KGSurface.m */; };
FE6F7C8D0FD55FA300C3244F /* KGzlib.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11ADC0FD4B4D600082282 /* KGzlib.m */; };
FE6F7C8F0FD55FA300C3244F /* KTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE00FD4B4D600082282 /* KTFont.m */; };
FE6F7C900FD55FA300C3244F /* NSTIFFImageFileDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE20FD4B4D600082282 /* NSTIFFImageFileDirectory.m */; };
FE6F7C910FD55FA300C3244F /* NSTIFFReader.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE40FD4B4D600082282 /* NSTIFFReader.m */; };
FE6F7C920FD55FA300C3244F /* VGPath.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE70FD4B4D600082282 /* VGPath.m */; };
@ -421,7 +411,6 @@
FEC11B0F0FD4B4D600082282 /* CGWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A5F0FD4B4D600082282 /* CGWindow.m */; };
FEC11B100FD4B4D600082282 /* CoreGraphics.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11A600FD4B4D600082282 /* CoreGraphics.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEC11B110FD4B4D600082282 /* CoreGraphicsExport.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11A610FD4B4D600082282 /* CoreGraphicsExport.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEC11B120FD4B4D600082282 /* CTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A620FD4B4D600082282 /* CTFont.m */; };
FEC11B130FD4B4D600082282 /* gif_lib.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11A630FD4B4D600082282 /* gif_lib.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEC11B140FD4B4D600082282 /* gif_lib.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11A640FD4B4D600082282 /* gif_lib.m */; };
FEC11B150FD4B4D600082282 /* KGBitmapContext.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11A650FD4B4D600082282 /* KGBitmapContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
@ -544,8 +533,6 @@
FEC11B8A0FD4B4D600082282 /* KGSurface.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11ADA0FD4B4D600082282 /* KGSurface.m */; };
FEC11B8B0FD4B4D600082282 /* KGzlib.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11ADB0FD4B4D600082282 /* KGzlib.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEC11B8C0FD4B4D600082282 /* KGzlib.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11ADC0FD4B4D600082282 /* KGzlib.m */; };
FEC11B8F0FD4B4D600082282 /* KTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11ADF0FD4B4D600082282 /* KTFont.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEC11B900FD4B4D600082282 /* KTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE00FD4B4D600082282 /* KTFont.m */; };
FEC11B910FD4B4D600082282 /* NSTIFFImageFileDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE10FD4B4D600082282 /* NSTIFFImageFileDirectory.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEC11B920FD4B4D600082282 /* NSTIFFImageFileDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE20FD4B4D600082282 /* NSTIFFImageFileDirectory.m */; };
FEC11B930FD4B4D600082282 /* NSTIFFReader.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE30FD4B4D600082282 /* NSTIFFReader.h */; settings = {ATTRIBUTES = (Private, ); }; };
@ -554,8 +541,6 @@
FEC11B960FD4B4D600082282 /* VGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11AE60FD4B4D600082282 /* VGPath.h */; settings = {ATTRIBUTES = (Private, ); }; };
FEC11B970FD4B4D600082282 /* VGPath.m in Sources */ = {isa = PBXBuildFile; fileRef = FEC11AE70FD4B4D600082282 /* VGPath.m */; };
FEC11BA50FD4B83E00082282 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
FEC11C050FD4C2BB00082282 /* CoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11C030FD4C2BB00082282 /* CoreText.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEC11C060FD4C2BB00082282 /* CTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC11C040FD4C2BB00082282 /* CTFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
@ -714,7 +699,6 @@
FEC11A5F0FD4B4D600082282 /* CGWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGWindow.m; sourceTree = "<group>"; };
FEC11A600FD4B4D600082282 /* CoreGraphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphics.h; sourceTree = "<group>"; };
FEC11A610FD4B4D600082282 /* CoreGraphicsExport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsExport.h; sourceTree = "<group>"; };
FEC11A620FD4B4D600082282 /* CTFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTFont.m; sourceTree = "<group>"; };
FEC11A630FD4B4D600082282 /* gif_lib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gif_lib.h; sourceTree = "<group>"; };
FEC11A640FD4B4D600082282 /* gif_lib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = gif_lib.m; sourceTree = "<group>"; };
FEC11A650FD4B4D600082282 /* KGBitmapContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KGBitmapContext.h; sourceTree = "<group>"; };
@ -837,8 +821,6 @@
FEC11ADA0FD4B4D600082282 /* KGSurface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KGSurface.m; sourceTree = "<group>"; };
FEC11ADB0FD4B4D600082282 /* KGzlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KGzlib.h; sourceTree = "<group>"; };
FEC11ADC0FD4B4D600082282 /* KGzlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KGzlib.m; sourceTree = "<group>"; };
FEC11ADF0FD4B4D600082282 /* KTFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KTFont.h; sourceTree = "<group>"; };
FEC11AE00FD4B4D600082282 /* KTFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KTFont.m; sourceTree = "<group>"; };
FEC11AE10FD4B4D600082282 /* NSTIFFImageFileDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTIFFImageFileDirectory.h; sourceTree = "<group>"; };
FEC11AE20FD4B4D600082282 /* NSTIFFImageFileDirectory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTIFFImageFileDirectory.m; sourceTree = "<group>"; };
FEC11AE30FD4B4D600082282 /* NSTIFFReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTIFFReader.h; sourceTree = "<group>"; };
@ -846,8 +828,6 @@
FEC11AE50FD4B4D600082282 /* VGmath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VGmath.h; sourceTree = "<group>"; };
FEC11AE60FD4B4D600082282 /* VGPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VGPath.h; sourceTree = "<group>"; };
FEC11AE70FD4B4D600082282 /* VGPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VGPath.m; sourceTree = "<group>"; };
FEC11C030FD4C2BB00082282 /* CoreText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreText.h; sourceTree = "<group>"; };
FEC11C040FD4C2BB00082282 /* CTFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTFont.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -938,9 +918,6 @@
FEC11A5F0FD4B4D600082282 /* CGWindow.m */,
FEC11A600FD4B4D600082282 /* CoreGraphics.h */,
FEC11A610FD4B4D600082282 /* CoreGraphicsExport.h */,
FEC11C030FD4C2BB00082282 /* CoreText.h */,
FEC11C040FD4C2BB00082282 /* CTFont.h */,
FEC11A620FD4B4D600082282 /* CTFont.m */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
FE6F7BC00FD5572F00C3244F /* Foundation.xcodeproj */,
FEC11A630FD4B4D600082282 /* gif_lib.h */,
@ -1067,8 +1044,6 @@
FEC11ADA0FD4B4D600082282 /* KGSurface.m */,
FEC11ADB0FD4B4D600082282 /* KGzlib.h */,
FEC11ADC0FD4B4D600082282 /* KGzlib.m */,
FEC11ADF0FD4B4D600082282 /* KTFont.h */,
FEC11AE00FD4B4D600082282 /* KTFont.m */,
FEC11AE10FD4B4D600082282 /* NSTIFFImageFileDirectory.h */,
FEC11AE20FD4B4D600082282 /* NSTIFFImageFileDirectory.m */,
FEC11AE30FD4B4D600082282 /* NSTIFFReader.h */,
@ -1219,13 +1194,10 @@
FEC11B870FD4B4D600082282 /* KGShading.h in Headers */,
FEC11B890FD4B4D600082282 /* KGSurface.h in Headers */,
FEC11B8B0FD4B4D600082282 /* KGzlib.h in Headers */,
FEC11B8F0FD4B4D600082282 /* KTFont.h in Headers */,
FEC11B910FD4B4D600082282 /* NSTIFFImageFileDirectory.h in Headers */,
FEC11B930FD4B4D600082282 /* NSTIFFReader.h in Headers */,
FEC11B950FD4B4D600082282 /* VGmath.h in Headers */,
FEC11B960FD4B4D600082282 /* VGPath.h in Headers */,
FEC11C050FD4C2BB00082282 /* CoreText.h in Headers */,
FEC11C060FD4C2BB00082282 /* CTFont.h in Headers */,
FE9DB4610FD6C38300A1CE17 /* CGDataConsumer.h in Headers */,
FEAED7100FD6C40E0043F915 /* KGDataConsumer.h in Headers */,
FEAED71C0FD6C4460043F915 /* CGPDFContext.h in Headers */,
@ -1320,13 +1292,10 @@
FE6F7B4B0FD554A800C3244F /* KGShading.h in Headers */,
FE6F7B4C0FD554A800C3244F /* KGSurface.h in Headers */,
FE6F7B4D0FD554A800C3244F /* KGzlib.h in Headers */,
FE6F7B4F0FD554A800C3244F /* KTFont.h in Headers */,
FE6F7B500FD554A800C3244F /* NSTIFFImageFileDirectory.h in Headers */,
FE6F7B510FD554A800C3244F /* NSTIFFReader.h in Headers */,
FE6F7B520FD554A800C3244F /* VGmath.h in Headers */,
FE6F7B530FD554A800C3244F /* VGPath.h in Headers */,
FE6F7B540FD554A800C3244F /* CoreText.h in Headers */,
FE6F7B550FD554A800C3244F /* CTFont.h in Headers */,
FE9DB4630FD6C38300A1CE17 /* CGDataConsumer.h in Headers */,
FEAED7120FD6C40E0043F915 /* KGDataConsumer.h in Headers */,
FEAED71E0FD6C4460043F915 /* CGPDFContext.h in Headers */,
@ -1421,13 +1390,10 @@
FE6F7C300FD55FA300C3244F /* KGShading.h in Headers */,
FE6F7C310FD55FA300C3244F /* KGSurface.h in Headers */,
FE6F7C320FD55FA300C3244F /* KGzlib.h in Headers */,
FE6F7C340FD55FA300C3244F /* KTFont.h in Headers */,
FE6F7C350FD55FA300C3244F /* NSTIFFImageFileDirectory.h in Headers */,
FE6F7C360FD55FA300C3244F /* NSTIFFReader.h in Headers */,
FE6F7C370FD55FA300C3244F /* VGmath.h in Headers */,
FE6F7C380FD55FA300C3244F /* VGPath.h in Headers */,
FE6F7C390FD55FA300C3244F /* CoreText.h in Headers */,
FE6F7C3A0FD55FA300C3244F /* CTFont.h in Headers */,
FE9DB4650FD6C38300A1CE17 /* CGDataConsumer.h in Headers */,
FEAED7140FD6C40E0043F915 /* KGDataConsumer.h in Headers */,
FEAED7200FD6C4460043F915 /* CGPDFContext.h in Headers */,
@ -1627,7 +1593,6 @@
FEC11B0B0FD4B4D600082282 /* CGPDFPage.m in Sources */,
FEC11B0D0FD4B4D600082282 /* CGShading.m in Sources */,
FEC11B0F0FD4B4D600082282 /* CGWindow.m in Sources */,
FEC11B120FD4B4D600082282 /* CTFont.m in Sources */,
FEC11B140FD4B4D600082282 /* gif_lib.m in Sources */,
FEC11B160FD4B4D600082282 /* KGBitmapContext.m in Sources */,
FEC11B190FD4B4D600082282 /* KGClipPhase.m in Sources */,
@ -1688,7 +1653,6 @@
FEC11B880FD4B4D600082282 /* KGShading.m in Sources */,
FEC11B8A0FD4B4D600082282 /* KGSurface.m in Sources */,
FEC11B8C0FD4B4D600082282 /* KGzlib.m in Sources */,
FEC11B900FD4B4D600082282 /* KTFont.m in Sources */,
FEC11B920FD4B4D600082282 /* NSTIFFImageFileDirectory.m in Sources */,
FEC11B940FD4B4D600082282 /* NSTIFFReader.m in Sources */,
FEC11B970FD4B4D600082282 /* VGPath.m in Sources */,
@ -1722,7 +1686,6 @@
FE6F7B690FD554A800C3244F /* CGPDFPage.m in Sources */,
FE6F7B6A0FD554A800C3244F /* CGShading.m in Sources */,
FE6F7B6B0FD554A800C3244F /* CGWindow.m in Sources */,
FE6F7B6C0FD554A800C3244F /* CTFont.m in Sources */,
FE6F7B6D0FD554A800C3244F /* gif_lib.m in Sources */,
FE6F7B6E0FD554A800C3244F /* KGBitmapContext.m in Sources */,
FE6F7B6F0FD554A800C3244F /* KGClipPhase.m in Sources */,
@ -1783,7 +1746,6 @@
FE6F7BA60FD554A800C3244F /* KGShading.m in Sources */,
FE6F7BA70FD554A800C3244F /* KGSurface.m in Sources */,
FE6F7BA80FD554A800C3244F /* KGzlib.m in Sources */,
FE6F7BAA0FD554A800C3244F /* KTFont.m in Sources */,
FE6F7BAB0FD554A800C3244F /* NSTIFFImageFileDirectory.m in Sources */,
FE6F7BAC0FD554A800C3244F /* NSTIFFReader.m in Sources */,
FE6F7BAD0FD554A800C3244F /* VGPath.m in Sources */,
@ -1817,7 +1779,6 @@
FE6F7C4E0FD55FA300C3244F /* CGPDFPage.m in Sources */,
FE6F7C4F0FD55FA300C3244F /* CGShading.m in Sources */,
FE6F7C500FD55FA300C3244F /* CGWindow.m in Sources */,
FE6F7C510FD55FA300C3244F /* CTFont.m in Sources */,
FE6F7C520FD55FA300C3244F /* gif_lib.m in Sources */,
FE6F7C530FD55FA300C3244F /* KGBitmapContext.m in Sources */,
FE6F7C540FD55FA300C3244F /* KGClipPhase.m in Sources */,
@ -1878,7 +1839,6 @@
FE6F7C8B0FD55FA300C3244F /* KGShading.m in Sources */,
FE6F7C8C0FD55FA300C3244F /* KGSurface.m in Sources */,
FE6F7C8D0FD55FA300C3244F /* KGzlib.m in Sources */,
FE6F7C8F0FD55FA300C3244F /* KTFont.m in Sources */,
FE6F7C900FD55FA300C3244F /* NSTIFFImageFileDirectory.m in Sources */,
FE6F7C910FD55FA300C3244F /* NSTIFFReader.m in Sources */,
FE6F7C920FD55FA300C3244F /* VGPath.m in Sources */,

View File

@ -6,18 +6,18 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
<string>org.cocotron.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>OBJC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>

View File

@ -131,7 +131,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)setFont:(KGFont *)font;
-(void)setFontSize:(float)size;
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(int)encoding;
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(CGTextEncoding)encoding;
-(void)setShouldSmoothFonts:(BOOL)yesOrNo;
-(void)setLineWidth:(float)width;

View File

@ -633,7 +633,7 @@ static inline KGGraphicsState *currentState(KGContext *self){
[currentState(self) setFontSize:size];
}
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(int)encoding {
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(CGTextEncoding)encoding {
[currentState(self) selectFontWithName:name size:size encoding:encoding];
}

View File

@ -6,264 +6,7 @@
@implementation KGFont(PDF)
static NSString *MacRomanEncoding[256]={
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@"space",
@"exclam",
@"quotedbl",
@"numbersign",
@"dollar",
@"percent",
@"ampersand",
@"quotesingle",
@"parenleft",
@"parenright",
@"asterisk",
@"plus",
@"comma",
@"hyphen",
@"period",
@"slash",
@"zero",
@"one",
@"two",
@"three",
@"four",
@"five",
@"six",
@"seven",
@"eight",
@"nine",
@"colon",
@"semicolon",
@"less",
@"equal",
@"greater",
@"question",
@"at",
@"A",
@"B",
@"C",
@"D",
@"E",
@"F",
@"G",
@"H",
@"I",
@"J",
@"K",
@"L",
@"M",
@"N",
@"O",
@"P",
@"Q",
@"R",
@"S",
@"T",
@"U",
@"V",
@"W",
@"X",
@"Y",
@"Z",
@"bracketleft",
@"backslash",
@"bracketright",
@"asciicircum",
@"underscore",
@"grave",
@"a",
@"b",
@"c",
@"d",
@"e",
@"f",
@"g",
@"h",
@"i",
@"j",
@"k",
@"l",
@"m",
@"n",
@"o",
@"p",
@"q",
@"r",
@"s",
@"t",
@"u",
@"v",
@"w",
@"x",
@"y",
@"z",
@"braceleft",
@"bar",
@"braceright",
@"asciitilde",
@".notdef",
@"Adieresis",
@"Aring",
@"Ccedilla",
@"Eacute",
@"Ntilde",
@"Odieresis",
@"Udieresis",
@"aacute",
@"agrave",
@"acircumflex",
@"adieresis",
@"atilde",
@"aring",
@"ccedilla",
@"eacute",
@"egrave",
@"ecircumflex",
@"edieresis",
@"iacute",
@"igrave",
@"icircumflex",
@"idieresis",
@"ntilde",
@"oacute",
@"ograve",
@"ocircumflex",
@"odieresis",
@"otilde",
@"uacute",
@"ugrave",
@"ucircumflex",
@"udieresis",
@"dagger",
@"degree",
@"cent",
@"sterling",
@"section",
@"bullet",
@"paragraph",
@"germandbls",
@"registered",
@"copyright",
@"trademark",
@"acute",
@"dieresis",
@"notequal",
@"AE",
@"Oslash",
@"infinity",
@"plusminus",
@"lessequal",
@"greaterequal",
@"yen",
@"mu",
@"partialdiff",
@"summation",
@"product",
@"pi",
@"integral",
@"ordfeminine",
@"ordmasculine",
@"Omegagreek",
@"ae",
@"oslash",
@"questiondown",
@"exclamdown",
@"logicalnot",
@"radical",
@"florin",
@"approxequal",
@"Delta",
@"guillemotleft",
@"guillemotright",
@"ellipsis",
@"nobreakspace",
@"Agrave",
@"Atilde",
@"Otilde",
@"OE",
@"oe",
@"endash",
@"emdash",
@"quotedblleft",
@"quotedblright",
@"commaturnedmod",
@"apostrophemod",
@"divide",
@"lozenge",
@"ydieresis",
@"Ydieresis",
@"fraction",
@"Euro",
@"guilsinglleft",
@"guilsinglright",
@"fi",
@"fl",
@"daggerdbl",
@"periodcentered",
@"quotesinglbase",
@"quotedblbase",
@"perthousand",
@"Acircumflex",
@"Ecircumflex",
@"Aacute",
@"Edieresis",
@"Egrave",
@"Iacute",
@"Icircumflex",
@"Idieresis",
@"Igrave",
@"Oacute",
@"Ocircumflex",
@"apple",
@"Ograve",
@"Uacute",
@"Ucircumflex",
@"Ugrave",
@"dotlessi",
@"circumflex",
@"tilde",
@"macron",
@"breve",
@"dotaccent",
@"ring",
@"cedilla",
@"hungarumlaut",
@"ogonek",
@"caron",
};
extern NSString *O2MacRomanGlyphNames[256];
uint8_t O2PDFMacRomanPositionOfGlyphName(NSString *name){
static NSDictionary *map=nil;
@ -272,7 +15,7 @@ uint8_t O2PDFMacRomanPositionOfGlyphName(NSString *name){
NSMutableDictionary *mutmap=[NSDictionary new];
int i;
for(i=0;i<256;i++)
[mutmap setObject:[NSNumber numberWithInt:i] forKey:MacRomanEncoding[i]];
[mutmap setObject:[NSNumber numberWithInt:i] forKey:O2MacRomanGlyphNames[i]];
map=mutmap;
}
@ -343,25 +86,14 @@ KGPDFArray *O2FontCreatePDFWidthsWithEncoding(O2FontRef self,CGGlyph encoding[25
return result;
}
// this is overriden for GDI
-(void)getMacRomanEncoding:(CGGlyph[256])encoding {
int i;
for(i=0;i<256;i++)
encoding[i]=O2FontGetGlyphWithGlyphName(self,MacRomanEncoding[i]);
}
-(KGPDFObject *)encodeReferenceWithContext:(KGPDFContext *)context size:(CGFloat)size {
KGPDFObject *reference=[context referenceForFontWithName:self->_name size:size];
if(reference==nil){
KGPDFDictionary *result=[KGPDFDictionary pdfDictionary];
CGGlyph encoding[256];
CGGlyph *encoding=[self MacRomanEncoding];
int i;
[self getMacRomanEncoding:encoding];
[result setNameForKey:"Type" value:"Font"];
[result setNameForKey:"Subtype" value:"TrueType"];
[result setNameForKey:"BaseFont" value:[self pdfFontName]];

View File

@ -24,6 +24,7 @@ typedef KGFont *O2FontRef;
CGRect _bbox;
int _numberOfGlyphs;
int *_advances;
CGGlyph *_MacRomanEncoding;
}
+(KGFont *)createWithFontName:(NSString *)name;
@ -36,6 +37,9 @@ typedef KGFont *O2FontRef;
-(void)fetchAdvances;
-(CGGlyph *)MacRomanEncoding;
-(CGGlyph *)glyphTableForEncoding:(CGTextEncoding)encoding;
O2FontRef O2FontCreateWithFontName(NSString *name);
O2FontRef O2FontRetain(O2FontRef self);
void O2FontRelease(O2FontRef self);

View File

@ -17,6 +17,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)dealloc {
[_name release];
if(_advances!=NULL)
NSZoneFree(NULL,_advances);
if(_MacRomanEncoding!=NULL)
NSZoneFree(NULL,_MacRomanEncoding);
[super dealloc];
}
@ -43,6 +47,281 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
KGInvalidAbstractInvocation();
}
NSString *O2MacRomanGlyphNames[256]={
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@".notdef",
@"space",
@"exclam",
@"quotedbl",
@"numbersign",
@"dollar",
@"percent",
@"ampersand",
@"quotesingle",
@"parenleft",
@"parenright",
@"asterisk",
@"plus",
@"comma",
@"hyphen",
@"period",
@"slash",
@"zero",
@"one",
@"two",
@"three",
@"four",
@"five",
@"six",
@"seven",
@"eight",
@"nine",
@"colon",
@"semicolon",
@"less",
@"equal",
@"greater",
@"question",
@"at",
@"A",
@"B",
@"C",
@"D",
@"E",
@"F",
@"G",
@"H",
@"I",
@"J",
@"K",
@"L",
@"M",
@"N",
@"O",
@"P",
@"Q",
@"R",
@"S",
@"T",
@"U",
@"V",
@"W",
@"X",
@"Y",
@"Z",
@"bracketleft",
@"backslash",
@"bracketright",
@"asciicircum",
@"underscore",
@"grave",
@"a",
@"b",
@"c",
@"d",
@"e",
@"f",
@"g",
@"h",
@"i",
@"j",
@"k",
@"l",
@"m",
@"n",
@"o",
@"p",
@"q",
@"r",
@"s",
@"t",
@"u",
@"v",
@"w",
@"x",
@"y",
@"z",
@"braceleft",
@"bar",
@"braceright",
@"asciitilde",
@".notdef",
@"Adieresis",
@"Aring",
@"Ccedilla",
@"Eacute",
@"Ntilde",
@"Odieresis",
@"Udieresis",
@"aacute",
@"agrave",
@"acircumflex",
@"adieresis",
@"atilde",
@"aring",
@"ccedilla",
@"eacute",
@"egrave",
@"ecircumflex",
@"edieresis",
@"iacute",
@"igrave",
@"icircumflex",
@"idieresis",
@"ntilde",
@"oacute",
@"ograve",
@"ocircumflex",
@"odieresis",
@"otilde",
@"uacute",
@"ugrave",
@"ucircumflex",
@"udieresis",
@"dagger",
@"degree",
@"cent",
@"sterling",
@"section",
@"bullet",
@"paragraph",
@"germandbls",
@"registered",
@"copyright",
@"trademark",
@"acute",
@"dieresis",
@"notequal",
@"AE",
@"Oslash",
@"infinity",
@"plusminus",
@"lessequal",
@"greaterequal",
@"yen",
@"mu",
@"partialdiff",
@"summation",
@"product",
@"pi",
@"integral",
@"ordfeminine",
@"ordmasculine",
@"Omegagreek",
@"ae",
@"oslash",
@"questiondown",
@"exclamdown",
@"logicalnot",
@"radical",
@"florin",
@"approxequal",
@"Delta",
@"guillemotleft",
@"guillemotright",
@"ellipsis",
@"nobreakspace",
@"Agrave",
@"Atilde",
@"Otilde",
@"OE",
@"oe",
@"endash",
@"emdash",
@"quotedblleft",
@"quotedblright",
@"commaturnedmod",
@"apostrophemod",
@"divide",
@"lozenge",
@"ydieresis",
@"Ydieresis",
@"fraction",
@"Euro",
@"guilsinglleft",
@"guilsinglright",
@"fi",
@"fl",
@"daggerdbl",
@"periodcentered",
@"quotesinglbase",
@"quotedblbase",
@"perthousand",
@"Acircumflex",
@"Ecircumflex",
@"Aacute",
@"Edieresis",
@"Egrave",
@"Iacute",
@"Icircumflex",
@"Idieresis",
@"Igrave",
@"Oacute",
@"Ocircumflex",
@"apple",
@"Ograve",
@"Uacute",
@"Ucircumflex",
@"Ugrave",
@"dotlessi",
@"circumflex",
@"tilde",
@"macron",
@"breve",
@"dotaccent",
@"ring",
@"cedilla",
@"hungarumlaut",
@"ogonek",
@"caron",
};
-(CGGlyph *)MacRomanEncoding {
if(_MacRomanEncoding==NULL){
int i;
_MacRomanEncoding=NSZoneMalloc(NULL,sizeof(CGGlyph)*256);
for(i=0;i<256;i++)
_MacRomanEncoding[i]=O2FontGetGlyphWithGlyphName(self,O2MacRomanGlyphNames[i]);
}
return _MacRomanEncoding;
}
-(CGGlyph *)glyphTableForEncoding:(CGTextEncoding)encoding {
return [self MacRomanEncoding];
}
O2FontRef O2FontCreateWithFontName(NSString *name) {
return [[KGFont alloc] initWithFontName:name];
}

View File

@ -22,6 +22,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
KGColor *_fillColor;
KGFont *_font;
CGFloat _pointSize;
CGTextEncoding _textEncoding;
id _fontState;
CGSize _patternPhase;
float _characterSpacing;
@ -91,11 +92,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)setTextDrawingMode:(int)textMode;
-(KGFont *)font;
-(CGFloat)pointSize;
-(CGTextEncoding)textEncoding;
-(CGGlyph *)glyphTableForTextEncoding;
-(id)fontState;
-(void)setFontState:(id)fontState;
-(void)setFont:(KGFont *)font;
-(void)setFontSize:(float)size;
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(int)encoding;
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(CGTextEncoding)encoding;
-(void)setShouldSmoothFonts:(BOOL)yesOrNo;
-(void)setLineWidth:(float)width;

View File

@ -29,6 +29,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_fillColor=[[KGColor alloc] init];
_font=nil;
_pointSize=12.0;
_textEncoding=kCGEncodingFontSpecific;
_fontState=nil;
_patternPhase=CGSizeMake(0,0);
_lineWidth=1.0;
@ -229,6 +230,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _pointSize;
}
-(CGTextEncoding)textEncoding {
return _textEncoding;
}
-(CGGlyph *)glyphTableForTextEncoding {
return [_font glyphTableForEncoding:_textEncoding];
}
-(id)fontState {
return _fontState;
}
@ -249,7 +258,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_pointSize=size;
}
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(int)encoding {
-(void)selectFontWithName:(const char *)name size:(float)size encoding:(CGTextEncoding)encoding {
KGFont *font=O2FontCreateWithFontName([NSString stringWithCString:name]);
if(font!=nil){
@ -258,6 +267,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
_pointSize=size;
_textEncoding=encoding;
}
-(void)setShouldSmoothFonts:(BOOL)yesOrNo {

39
CoreText/CTFont.h Normal file
View File

@ -0,0 +1,39 @@
/* Copyright (c) 2007 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <Foundation/NSObject.h>
#import <CoreText/CoreTextExport.h>
#import <CoreGraphics/CGAffineTransform.h>
#import <CoreGraphics/CGFont.h>
#import <CoreGraphics/CGPath.h>
@class KTFont;
typedef KTFont *CTFontRef;
typedef enum {
kCTFontMenuTitleFontType,
kCTFontMenuItemFontType,
} CTFontUIFontType;
CORETEXT_EXPORT CTFontRef CTFontCreateWithGraphicsFont(CGFontRef cgFont,CGFloat size,CGAffineTransform *xform,id attributes);
CORETEXT_EXPORT CTFontRef CTFontCreateUIFontForLanguage(CTFontUIFontType uiFontType,CGFloat size,NSString *language);
CORETEXT_EXPORT NSString *CTFontCopyFullName(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetSize(CTFontRef self);
CORETEXT_EXPORT size_t CTFontGetGlyphCount(CTFontRef self);
CORETEXT_EXPORT BOOL CTFontGetGlyphsForCharacters(CTFontRef self,const unichar *characters,CGGlyph *glyphs,size_t count);
CORETEXT_EXPORT CGRect CTFontGetBoundingBox(CTFontRef self);
CORETEXT_EXPORT void CTFontGetAdvancesForGlyphs(CTFontRef self,int orientation,const CGGlyph *glyphs,CGSize *advances,size_t count);
CORETEXT_EXPORT CGFloat CTFontGetUnderlinePosition(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetUnderlineThickness(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetAscent(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetDescent(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetLeading(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetSlantAngle(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetXHeight(CTFontRef self);
CORETEXT_EXPORT CGFloat CTFontGetCapHeight(CTFontRef self);
CORETEXT_EXPORT CGPathRef CTFontCreatePathForGlyph(CTFontRef self,CGGlyph glyph,CGAffineTransform *xform);

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <CoreGraphics/CTFont.h>
#import <CoreText/CTFont.h>
#import "KTFont.h"
CTFontRef CTFontCreateWithGraphicsFont(CGFontRef cgFont,CGFloat size,CGAffineTransform *xform,id attributes) {

View File

@ -0,0 +1,621 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
FECF92110FFB217F007AECF1 /* CoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920B0FFB217F007AECF1 /* CoreText.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92120FFB217F007AECF1 /* CoreTextExport.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920C0FFB217F007AECF1 /* CoreTextExport.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92130FFB217F007AECF1 /* CTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920D0FFB217F007AECF1 /* CTFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92140FFB217F007AECF1 /* CTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FECF920E0FFB217F007AECF1 /* CTFont.m */; };
FECF92150FFB217F007AECF1 /* KTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920F0FFB217F007AECF1 /* KTFont.h */; settings = {ATTRIBUTES = (Private, ); }; };
FECF92160FFB217F007AECF1 /* KTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FECF92100FFB217F007AECF1 /* KTFont.m */; };
FECF92330FFB29FF007AECF1 /* CoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920B0FFB217F007AECF1 /* CoreText.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92340FFB29FF007AECF1 /* CoreTextExport.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920C0FFB217F007AECF1 /* CoreTextExport.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92350FFB29FF007AECF1 /* CTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920D0FFB217F007AECF1 /* CTFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92360FFB29FF007AECF1 /* KTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920F0FFB217F007AECF1 /* KTFont.h */; settings = {ATTRIBUTES = (Private, ); }; };
FECF923A0FFB29FF007AECF1 /* CTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FECF920E0FFB217F007AECF1 /* CTFont.m */; };
FECF923B0FFB29FF007AECF1 /* KTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FECF92100FFB217F007AECF1 /* KTFont.m */; };
FECF92430FFB2A0D007AECF1 /* CoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920B0FFB217F007AECF1 /* CoreText.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92440FFB2A0D007AECF1 /* CoreTextExport.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920C0FFB217F007AECF1 /* CoreTextExport.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92450FFB2A0D007AECF1 /* CTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920D0FFB217F007AECF1 /* CTFont.h */; settings = {ATTRIBUTES = (Public, ); }; };
FECF92460FFB2A0D007AECF1 /* KTFont.h in Headers */ = {isa = PBXBuildFile; fileRef = FECF920F0FFB217F007AECF1 /* KTFont.h */; settings = {ATTRIBUTES = (Private, ); }; };
FECF924A0FFB2A0D007AECF1 /* CTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FECF920E0FFB217F007AECF1 /* CTFont.m */; };
FECF924B0FFB2A0D007AECF1 /* KTFont.m in Sources */ = {isa = PBXBuildFile; fileRef = FECF92100FFB217F007AECF1 /* KTFont.m */; };
FECF92870FFB2C32007AECF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
FECF92880FFB2C3A007AECF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
FECF92890FFB2C3B007AECF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
FECF928C0FFB2C5C007AECF1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FECF928B0FFB2C5C007AECF1 /* CoreGraphics.framework */; };
FECF928D0FFB2C5C007AECF1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FECF928B0FFB2C5C007AECF1 /* CoreGraphics.framework */; };
FECF928E0FFB2C5C007AECF1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FECF928B0FFB2C5C007AECF1 /* CoreGraphics.framework */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FECF92600FFB2B8F007AECF1 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
FECF92610FFB2B8F007AECF1 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.linux.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
FECF92710FFB2BA7007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8DC2EF5B0486A6940098B216 /* CoreGraphics.framework */;
remoteInfo = "CoreGraphics-Windows-i386";
};
FECF92730FFB2BA7007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FE6F7BB30FD554A800C3244F /* CoreGraphics.framework */;
remoteInfo = "CoreGraphics-Linux-i386";
};
FECF92750FFB2BA7007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FE6F7C980FD55FA300C3244F /* CoreGraphics.framework */;
remoteInfo = "CoreGraphics-Darwin-i386";
};
FECF92770FFB2BB0007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 8DC2EF4F0486A6940098B216 /* CoreGraphics-Windows-i386 */;
remoteInfo = "CoreGraphics-Windows-i386";
};
FECF92790FFB2BB8007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = FE6F7AF80FD554A800C3244F /* CoreGraphics-Linux-i386 */;
remoteInfo = "CoreGraphics-Linux-i386";
};
FECF927B0FFB2BBF007AECF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = FE6F7BDB0FD55FA300C3244F /* CoreGraphics-Darwin-i386 */;
remoteInfo = "CoreGraphics-Darwin-i386";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* CoreText.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreText.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FECF920B0FFB217F007AECF1 /* CoreText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreText.h; sourceTree = "<group>"; };
FECF920C0FFB217F007AECF1 /* CoreTextExport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreTextExport.h; sourceTree = "<group>"; };
FECF920D0FFB217F007AECF1 /* CTFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTFont.h; sourceTree = "<group>"; };
FECF920E0FFB217F007AECF1 /* CTFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CTFont.m; sourceTree = "<group>"; };
FECF920F0FFB217F007AECF1 /* KTFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KTFont.h; sourceTree = "<group>"; };
FECF92100FFB217F007AECF1 /* KTFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KTFont.m; sourceTree = "<group>"; };
FECF923F0FFB29FF007AECF1 /* CoreText.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreText.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FECF924F0FFB2A0D007AECF1 /* CoreText.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreText.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CoreGraphics.xcodeproj; path = ../CoreGraphics/CoreGraphics.xcodeproj; sourceTree = SOURCE_ROOT; };
FECF928B0FFB2C5C007AECF1 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Cocotron/1.0/Windows/i386/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DC2EF560486A6940098B216 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92870FFB2C32007AECF1 /* Foundation.framework in Frameworks */,
FECF928C0FFB2C5C007AECF1 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF923C0FFB29FF007AECF1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92880FFB2C3A007AECF1 /* Foundation.framework in Frameworks */,
FECF928E0FFB2C5C007AECF1 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF924C0FFB2A0D007AECF1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92890FFB2C3B007AECF1 /* Foundation.framework in Frameworks */,
FECF928D0FFB2C5C007AECF1 /* CoreGraphics.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
034768DFFF38A50411DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
8DC2EF5B0486A6940098B216 /* CoreText.framework */,
FECF923F0FFB29FF007AECF1 /* CoreText.framework */,
FECF924F0FFB2A0D007AECF1 /* CoreText.framework */,
);
name = Products;
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* CoreText */ = {
isa = PBXGroup;
children = (
FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */,
08FB77AEFE84172EC02AAC07 /* Classes */,
32C88DFF0371C24200C91783 /* Other Sources */,
089C1665FE841158C02AAC07 /* Resources */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
034768DFFF38A50411DB9C8B /* Products */,
);
name = CoreText;
sourceTree = "<group>";
};
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
FECF928B0FFB2C5C007AECF1 /* CoreGraphics.framework */,
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8DC2EF5A0486A6940098B216 /* Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77AEFE84172EC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
FECF920B0FFB217F007AECF1 /* CoreText.h */,
FECF920C0FFB217F007AECF1 /* CoreTextExport.h */,
FECF920D0FFB217F007AECF1 /* CTFont.h */,
FECF920E0FFB217F007AECF1 /* CTFont.m */,
FECF920F0FFB217F007AECF1 /* KTFont.h */,
FECF92100FFB217F007AECF1 /* KTFont.m */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
0867D69BFE84028FC02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
32C88DFF0371C24200C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
);
name = "Other Sources";
sourceTree = "<group>";
};
FECF926C0FFB2BA7007AECF1 /* Products */ = {
isa = PBXGroup;
children = (
FECF92720FFB2BA7007AECF1 /* CoreGraphics.framework */,
FECF92740FFB2BA7007AECF1 /* CoreGraphics.framework */,
FECF92760FFB2BA7007AECF1 /* CoreGraphics.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8DC2EF500486A6940098B216 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92110FFB217F007AECF1 /* CoreText.h in Headers */,
FECF92120FFB217F007AECF1 /* CoreTextExport.h in Headers */,
FECF92130FFB217F007AECF1 /* CTFont.h in Headers */,
FECF92150FFB217F007AECF1 /* KTFont.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF92320FFB29FF007AECF1 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92330FFB29FF007AECF1 /* CoreText.h in Headers */,
FECF92340FFB29FF007AECF1 /* CoreTextExport.h in Headers */,
FECF92350FFB29FF007AECF1 /* CTFont.h in Headers */,
FECF92360FFB29FF007AECF1 /* KTFont.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF92420FFB2A0D007AECF1 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92430FFB2A0D007AECF1 /* CoreText.h in Headers */,
FECF92440FFB2A0D007AECF1 /* CoreTextExport.h in Headers */,
FECF92450FFB2A0D007AECF1 /* CTFont.h in Headers */,
FECF92460FFB2A0D007AECF1 /* KTFont.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
8DC2EF4F0486A6940098B216 /* CoreText-Windows-i386 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CoreText-Windows-i386" */;
buildPhases = (
8DC2EF500486A6940098B216 /* Headers */,
8DC2EF520486A6940098B216 /* Resources */,
8DC2EF540486A6940098B216 /* Sources */,
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FECF92600FFB2B8F007AECF1 /* PBXBuildRule */,
);
dependencies = (
FECF92780FFB2BB0007AECF1 /* PBXTargetDependency */,
);
name = "CoreText-Windows-i386";
productInstallPath = "$(HOME)/Library/Frameworks";
productName = CoreText;
productReference = 8DC2EF5B0486A6940098B216 /* CoreText.framework */;
productType = "com.apple.product-type.framework";
};
FECF92310FFB29FF007AECF1 /* CoreText-Linux-i386 */ = {
isa = PBXNativeTarget;
buildConfigurationList = FECF923D0FFB29FF007AECF1 /* Build configuration list for PBXNativeTarget "CoreText-Linux-i386" */;
buildPhases = (
FECF92320FFB29FF007AECF1 /* Headers */,
FECF92370FFB29FF007AECF1 /* Resources */,
FECF92390FFB29FF007AECF1 /* Sources */,
FECF923C0FFB29FF007AECF1 /* Frameworks */,
);
buildRules = (
FECF92610FFB2B8F007AECF1 /* PBXBuildRule */,
);
dependencies = (
FECF927A0FFB2BB8007AECF1 /* PBXTargetDependency */,
);
name = "CoreText-Linux-i386";
productInstallPath = "$(HOME)/Library/Frameworks";
productName = CoreText;
productReference = FECF923F0FFB29FF007AECF1 /* CoreText.framework */;
productType = "com.apple.product-type.framework";
};
FECF92410FFB2A0D007AECF1 /* CoreText-Darwin-i386 */ = {
isa = PBXNativeTarget;
buildConfigurationList = FECF924D0FFB2A0D007AECF1 /* Build configuration list for PBXNativeTarget "CoreText-Darwin-i386" */;
buildPhases = (
FECF92420FFB2A0D007AECF1 /* Headers */,
FECF92470FFB2A0D007AECF1 /* Resources */,
FECF92490FFB2A0D007AECF1 /* Sources */,
FECF924C0FFB2A0D007AECF1 /* Frameworks */,
);
buildRules = (
);
dependencies = (
FECF927C0FFB2BBF007AECF1 /* PBXTargetDependency */,
);
name = "CoreText-Darwin-i386";
productInstallPath = "$(HOME)/Library/Frameworks";
productName = CoreText;
productReference = FECF924F0FFB2A0D007AECF1 /* CoreText.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreText" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* CoreText */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = FECF926C0FFB2BA7007AECF1 /* Products */;
ProjectRef = FECF926B0FFB2BA7007AECF1 /* CoreGraphics.xcodeproj */;
},
);
projectRoot = "";
targets = (
8DC2EF4F0486A6940098B216 /* CoreText-Windows-i386 */,
FECF92310FFB29FF007AECF1 /* CoreText-Linux-i386 */,
FECF92410FFB2A0D007AECF1 /* CoreText-Darwin-i386 */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
FECF92720FFB2BA7007AECF1 /* CoreGraphics.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CoreGraphics.framework;
remoteRef = FECF92710FFB2BA7007AECF1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FECF92740FFB2BA7007AECF1 /* CoreGraphics.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CoreGraphics.framework;
remoteRef = FECF92730FFB2BA7007AECF1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FECF92760FFB2BA7007AECF1 /* CoreGraphics.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CoreGraphics.framework;
remoteRef = FECF92750FFB2BA7007AECF1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
8DC2EF520486A6940098B216 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF92370FFB29FF007AECF1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF92470FFB2A0D007AECF1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DC2EF540486A6940098B216 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FECF92140FFB217F007AECF1 /* CTFont.m in Sources */,
FECF92160FFB217F007AECF1 /* KTFont.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF92390FFB29FF007AECF1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FECF923A0FFB29FF007AECF1 /* CTFont.m in Sources */,
FECF923B0FFB29FF007AECF1 /* KTFont.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FECF92490FFB2A0D007AECF1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FECF924A0FFB2A0D007AECF1 /* CTFont.m in Sources */,
FECF924B0FFB2A0D007AECF1 /* KTFont.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
FECF92780FFB2BB0007AECF1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "CoreGraphics-Windows-i386";
targetProxy = FECF92770FFB2BB0007AECF1 /* PBXContainerItemProxy */;
};
FECF927A0FFB2BB8007AECF1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "CoreGraphics-Linux-i386";
targetProxy = FECF92790FFB2BB8007AECF1 /* PBXContainerItemProxy */;
};
FECF927C0FFB2BBF007AECF1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "CoreGraphics-Darwin-i386";
targetProxy = FECF927B0FFB2BBF007AECF1 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
1DEB91AF08733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = i386;
DEPLOYMENT_LOCATION = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DSTROOT = /;
EXECUTABLE_SUFFIX = .1.0.dll;
FRAMEWORK_SEARCH_PATHS = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = s;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = Info.plist;
INSTALL_MODE_FLAG = "og-w,a+rX";
INSTALL_PATH = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
OTHER_CFLAGS = (
"-DCORETEXT_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
OTHER_LDFLAGS = (
"-shared",
"-lgdi32",
"-Wl,--enable-auto-import",
"-Wl,--export-all-symbols",
"-Wl,--image-base=0x20000000",
"-Wl,--out-implib,$TARGET_BUILD_DIR/CoreText.framework/libCoreText.a",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = /Developer/Cocotron/1.0/build/CoreText/Windows;
};
name = Release;
};
1DEB91B308733DA50010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
FECF923E0FFB29FF007AECF1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = i386;
DEPLOYMENT_LOCATION = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DSTROOT = /;
EXECUTABLE_PREFIX = lib;
EXECUTABLE_SUFFIX = .so;
FRAMEWORK_SEARCH_PATHS = (
/Developer/Cocotron/1.0/Linux/i386/Frameworks,
"\"$(DEVELOPER_DIR)/Cocotron/1.0/Windows/i386/Frameworks\"",
);
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = s;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = Info.plist;
INSTALL_MODE_FLAG = "og-w,a+rX";
INSTALL_PATH = /Developer/Cocotron/1.0/Linux/i386/Frameworks;
OTHER_CFLAGS = (
"-DCORETEXT_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
OTHER_LDFLAGS = (
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = /Developer/Cocotron/1.0/build/CoreText/Linux;
};
name = Release;
};
FECF924E0FFB2A0D007AECF1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = i386;
DEPLOYMENT_LOCATION = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DSTROOT = /;
EXECUTABLE_PREFIX = lib;
EXECUTABLE_SUFFIX = .so;
FRAMEWORK_SEARCH_PATHS = (
/Developer/Cocotron/1.0/Darwin/i386/Frameworks,
"\"$(DEVELOPER_DIR)/Cocotron/1.0/Windows/i386/Frameworks\"",
);
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = s;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = Info.plist;
INSTALL_MODE_FLAG = "og-w,a+rX";
INSTALL_PATH = /Developer/Cocotron/1.0/Darwin/i386/Frameworks;
OTHER_CFLAGS = (
"-DCORETEXT_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
OTHER_LDFLAGS = (
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = /Developer/Cocotron/1.0/build/CoreText/Darwin;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CoreText-Windows-i386" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91AF08733DA50010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreText" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91B308733DA50010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FECF923D0FFB29FF007AECF1 /* Build configuration list for PBXNativeTarget "CoreText-Linux-i386" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FECF923E0FFB29FF007AECF1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FECF924D0FFB2A0D007AECF1 /* Build configuration list for PBXNativeTarget "CoreText-Darwin-i386" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FECF924E0FFB2A0D007AECF1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}

26
CoreText/Info.plist Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.cocotron.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>OBJC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -7,11 +7,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <Foundation/NSString.h>
#import <CoreGraphics/CoreGraphics.h>
#ifdef SWRENDER
#import <CoreText/CTFont.h>
#else
#import <CoreGraphics/CTFont.h>
#endif
enum {
CGNullGlyph=0x0

View File

@ -6,7 +6,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "KTFont.h"
#import "KGExceptions.h"
#import <CoreGraphics/KGExceptions.h>
#import <Foundation/NSArray.h>
@implementation KTFont