diff options
author | nyamatongwe <devnull@localhost> | 2011-08-07 13:41:35 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2011-08-07 13:41:35 +1000 |
commit | b510d1fe619eff95c7e0d0a88421b8e3cad8f729 (patch) | |
tree | 595b5f8217a081087316de368c15d7c0a4f586b4 /src/ViewStyle.cxx | |
parent | a320c92efc362ad68b903e73e848b4e8781fa4ec (diff) | |
download | scintilla-mirror-b510d1fe619eff95c7e0d0a88421b8e3cad8f729.tar.gz |
Implement APIs for fractional font sizes and a range of weights.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r-- | src/ViewStyle.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 9ba69b1ce..b46cd9eb4 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -88,12 +88,12 @@ FontRealised::~FontRealised() { void FontRealised::Realise(Surface &surface, int zoomLevel) { PLATFORM_ASSERT(fontName); - sizeZoomed = size + zoomLevel; - if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 - sizeZoomed = 2; + sizeZoomed = size + zoomLevel * SC_FONT_SIZE_MULTIPLIER; + if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1 + sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER; int deviceHeight = surface.DeviceHeightFont(sizeZoomed); - font.Create(fontName, characterSet, deviceHeight, bold, italic, extraFontFlag); + font.Create(fontName, characterSet, deviceHeight, weight, italic, extraFontFlag); ascent = surface.Ascent(font); descent = surface.Descent(font); @@ -457,9 +457,9 @@ void ViewStyle::EnsureStyle(size_t index) { void ViewStyle::ResetDefaultStyle() { styles[STYLE_DEFAULT].Clear(ColourDesired(0,0,0), ColourDesired(0xff,0xff,0xff), - Platform::DefaultFontSize(), fontNames.Save(Platform::DefaultFont()), + Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, fontNames.Save(Platform::DefaultFont()), SC_CHARSET_DEFAULT, - false, false, false, false, Style::caseMixed, true, true, false); + SC_WEIGHT_NORMAL, false, false, false, Style::caseMixed, true, true, false); } void ViewStyle::ClearStyles() { |