diff options
author | mixedpuppy <devnull@localhost> | 2007-12-05 23:06:58 +0000 |
---|---|---|
committer | mixedpuppy <devnull@localhost> | 2007-12-05 23:06:58 +0000 |
commit | ffa2c5b99b0eb534498a550d11ac5debc1204c32 (patch) | |
tree | 7a56a2c74170e09c85b98ecdeebce310d001ad7d /macosx/QuartzTextStyleAttribute.h | |
parent | a9e5e58a8d7875426b4d6d009254fc6ec191cbba (diff) | |
download | scintilla-mirror-ffa2c5b99b0eb534498a550d11ac5debc1204c32.tar.gz |
modified version of adobe OSX patches. Most of these patches are provided by Adobe, though I've
reorganized a lot of them
- improved drag/drop
- make copy/paste use modern pasteboard api's
- optimized textlayout usage
- reduce assertions for debug builds
- implement IME support
- other minor things
patches are available in openkomodo, which is a good test ground for scintilla osx (until someone
ports SCiTE).
Diffstat (limited to 'macosx/QuartzTextStyleAttribute.h')
-rw-r--r-- | macosx/QuartzTextStyleAttribute.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/macosx/QuartzTextStyleAttribute.h b/macosx/QuartzTextStyleAttribute.h index 490ef7d02..89b43721e 100644 --- a/macosx/QuartzTextStyleAttribute.h +++ b/macosx/QuartzTextStyleAttribute.h @@ -1,9 +1,10 @@ /* * QuartzTextStyleAttribute.h - * wtf * - * Created by Evan Jones on Wed Oct 02 2002. - * Copyright (c) 2002 __MyCompanyName__. All rights reserved. + * Original Code by Evan Jones on Wed Oct 02 2002. + * Contributors: + * Shane Caraveo, ActiveState + * Bernd Paradies, Adobe * */ @@ -16,6 +17,8 @@ class QuartzTextStyleAttribute { public: + QuartzTextStyleAttribute() {} + virtual ~QuartzTextStyleAttribute() {} virtual ByteCount getSize() const = 0; virtual ATSUAttributeValuePtr getValuePtr() = 0; virtual ATSUAttributeTag getTag() const = 0; @@ -104,17 +107,12 @@ public: QuartzFont( const char* name, int length ) { assert( name != NULL && length > 0 && name[length] == '\0' ); - /*CFStringRef fontName = CFStringCreateWithCString( NULL, name, kCFStringEncodingMacRoman ); - - ATSFontRef fontRef = ATSFontFindFromName( fontName, kATSOptionFlagsDefault ); - assert( fontRef != NULL ); - fontid = fontRef; + // try to create font + OSStatus err = ATSUFindFontFromName( const_cast<char*>( name ), length, kFontFullName, (unsigned) kFontNoPlatform, kFontRomanScript, (unsigned) kFontNoLanguage, &fontid ); - CFRelease( fontName );*/ - - OSStatus err; - err = ATSUFindFontFromName( const_cast<char*>( name ), length, kFontFullName, (unsigned) kFontNoPlatform, kFontRomanScript, (unsigned) kFontNoLanguage, &fontid ); - //assert( err == noErr && fontid != kATSUInvalidFontID ); + // need a fallback if font isn't installed + if( err != noErr || fontid == kATSUInvalidFontID ) + ::ATSUFindFontFromName( "Lucida Grande", 13, kFontFullName, (unsigned) kFontNoPlatform, kFontRomanScript, (unsigned) kFontNoLanguage, &fontid ); } ByteCount getSize() const |