aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2011-08-07 19:39:15 +1000
committernyamatongwe <nyamatongwe@gmail.com>2011-08-07 19:39:15 +1000
commit83a58ae4efb07e4d2de8cb21e5cca86a26f138ce (patch)
tree55c2916243bd5583e4f6c554ba9061541e7129a2
parentd7d7eab8c6553f8798f6ea1730cd2ea0cd33564b (diff)
downloadscintilla-mirror-83a58ae4efb07e4d2de8cb21e5cca86a26f138ce.tar.gz
Support a range of weights on Cocoa.
-rw-r--r--cocoa/PlatCocoa.mm2
-rw-r--r--cocoa/QuartzTextStyleAttribute.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 1972fa7a9..0965409c1 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -156,7 +156,7 @@ static int FontCharacterSet(Font &f) {
/**
* Creates a CTFontRef with the given properties.
*/
-void Font::Create(const char *faceName, int characterSet, float size, bool bold, bool italic,
+void Font::Create(const char *faceName, int characterSet, float size, int weight, bool italic,
int /* extraFontFlag */)
{
Release();
diff --git a/cocoa/QuartzTextStyleAttribute.h b/cocoa/QuartzTextStyleAttribute.h
index 33c49281c..b9698645e 100644
--- a/cocoa/QuartzTextStyleAttribute.h
+++ b/cocoa/QuartzTextStyleAttribute.h
@@ -16,12 +16,13 @@ class QuartzFont
{
public:
/** Create a font style from a name. */
- QuartzFont( const char* name, size_t length, float size, bool bold, bool italic )
+ QuartzFont( const char* name, size_t length, float size, int weight, bool italic )
{
assert( name != NULL && length > 0 && name[length] == '\0' );
CFStringRef fontName = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman);
assert(fontName != NULL);
+ bool bold = weight > SC_WEIGHT_NORMAL;
if (bold || italic)
{