MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / Realise

Method Realise

scintilla/src/ViewStyle.cxx:68–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs) {
69 PLATFORM_ASSERT(fs.fontName);
70 sizeZoomed = fs.size + zoomLevel * SC_FONT_SIZE_MULTIPLIER;
71 if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
72 sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
73
74 float deviceHeight = surface.DeviceHeightFont(sizeZoomed);
75 FontParameters fp(fs.fontName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, fs.weight, fs.italic, fs.extraFontFlag, technology, fs.characterSet);
76 font.Create(fp);
77
78 ascent = surface.Ascent(font);
79 descent = surface.Descent(font);
80 aveCharWidth = surface.AverageCharWidth(font);
81 spaceWidth = surface.WidthChar(font, ' ');
82}
83
84ViewStyle::ViewStyle() {
85 Init();

Callers 1

RefreshMethod · 0.80

Calls 6

DeviceHeightFontMethod · 0.80
AscentMethod · 0.80
DescentMethod · 0.80
AverageCharWidthMethod · 0.80
WidthCharMethod · 0.80
CreateMethod · 0.45

Tested by

no test coverage detected