diff options
-rw-r--r-- | src/LexHTML.cxx | 2 | ||||
-rw-r--r-- | src/Style.cxx | 19 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index fa88ab6ac..ae2de8ff2 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -25,7 +25,7 @@ static int segIsScriptingIndicator(StylingContext &styler, unsigned int start, u s[i] = tolower(styler[start + i]); s[i + 1] = '\0'; } -Platform::DebugPrintf("Scripting indicator [%s]\n", s); +//Platform::DebugPrintf("Scripting indicator [%s]\n", s); if (strstr(s, "vbs")) return eScriptVBS; if (strstr(s, "pyth")) diff --git a/src/Style.cxx b/src/Style.cxx index 75dc6eb93..3faca473f 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -10,14 +10,16 @@ #include "Style.h" Style::Style() { - aliasOfDefaultFont = false; + aliasOfDefaultFont = true; Clear(Colour(0,0,0), Colour(0xff,0xff,0xff), Platform::DefaultFontSize(), 0, false, false, false); } Style::~Style() { - if (!aliasOfDefaultFont) + if (aliasOfDefaultFont) + font.SetID(0); + else font.Release(); aliasOfDefaultFont = false; } @@ -46,10 +48,10 @@ void Style::Clear(Colour fore_, Colour back_, int size_, const char *fontName_, size = size_; fontName = fontName_; eolFilled = eolFilled_; - if (!aliasOfDefaultFont) - font.Release(); - else + if (aliasOfDefaultFont) font.SetID(0); + else + font.Release(); aliasOfDefaultFont = false; } @@ -72,13 +74,18 @@ void Style::Realise(Surface &surface, int zoomLevel, Style *defaultStyle) { if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 sizeZoomed = 2; - font.Release(); + if (aliasOfDefaultFont) + font.SetID(0); + else + font.Release(); int deviceHeight = (sizeZoomed * surface.LogPixelsY()) / 72; aliasOfDefaultFont = defaultStyle && EquivalentFontTo(defaultStyle); if (aliasOfDefaultFont) { font.SetID(defaultStyle->font.GetID()); } else if (fontName) { font.Create(fontName, deviceHeight, bold, italic); + } else { + font.SetID(0); } ascent = surface.Ascent(font); |