diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/EditView.cxx | 3 | ||||
-rw-r--r-- | src/Style.h | 1 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index d40ac51d8..50555b0a1 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -818,8 +818,7 @@ static void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle r surface->FillRectangle(rcSegment, textBack); } FontAlias ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font; - int normalCharHeight = static_cast<int>(surface->Ascent(ctrlCharsFont) - - surface->InternalLeading(ctrlCharsFont)); + const int normalCharHeight = static_cast<int>(ceil(vsDraw.styles[STYLE_CONTROLCHAR].capitalHeight)); PRectangle rcCChar = rcSegment; rcCChar.left = rcCChar.left + 1; rcCChar.top = rcSegment.top + vsDraw.maxAscent - normalCharHeight; diff --git a/src/Style.h b/src/Style.h index b3b3852da..adf5010c7 100644 --- a/src/Style.h +++ b/src/Style.h @@ -46,6 +46,7 @@ public: struct FontMeasurements { unsigned int ascent; unsigned int descent; + XYPOSITION capitalHeight; // Top of capital letter to baseline: ascent - internal leading XYPOSITION aveCharWidth; XYPOSITION spaceWidth; int sizeZoomed; diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 354124cd1..39661ddc2 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -86,6 +86,7 @@ void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, cons ascent = static_cast<unsigned int>(surface.Ascent(font)); descent = static_cast<unsigned int>(surface.Descent(font)); + capitalHeight = surface.Ascent(font) - surface.InternalLeading(font); aveCharWidth = surface.AverageCharWidth(font); spaceWidth = surface.WidthChar(font, ' '); } |