aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ViewStyle.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r--src/ViewStyle.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index f553f4205..aa6779728 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -42,14 +42,15 @@ FontRealised::FontRealised() noexcept = default;
FontRealised::~FontRealised() {
}
-void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs) {
+void FontRealised::Realise(Surface &surface, int zoomLevel, int technology, const FontSpecification &fs, const char *localeName) {
PLATFORM_ASSERT(fs.fontName);
sizeZoomed = fs.size + zoomLevel * SC_FONT_SIZE_MULTIPLIER;
if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER;
const float deviceHeight = static_cast<float>(surface.DeviceHeightFont(sizeZoomed));
- const FontParameters fp(fs.fontName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, fs.weight, fs.italic, fs.extraFontFlag, technology, fs.characterSet);
+ const FontParameters fp(fs.fontName, deviceHeight / SC_FONT_SIZE_MULTIPLIER, fs.weight,
+ fs.italic, fs.extraFontFlag, technology, fs.characterSet, localeName);
font = Font::Allocate(fp);
ascent = static_cast<unsigned int>(surface.Ascent(font.get()));
@@ -152,6 +153,8 @@ ViewStyle::ViewStyle(const ViewStyle &source) : markers(MARKER_MAX + 1), indicat
wrapVisualFlagsLocation = source.wrapVisualFlagsLocation;
wrapVisualStartIndent = source.wrapVisualStartIndent;
wrapIndentMode = source.wrapIndentMode;
+
+ localeName = source.localeName;
}
ViewStyle::~ViewStyle() {
@@ -286,6 +289,8 @@ void ViewStyle::Init(size_t stylesSize_) {
wrapVisualFlagsLocation = 0;
wrapVisualStartIndent = 0;
wrapIndentMode = SC_WRAPINDENT_FIXED;
+
+ localeName = localeNameDefault;
}
void ViewStyle::Refresh(Surface &surface, int tabInChars) {
@@ -307,7 +312,7 @@ void ViewStyle::Refresh(Surface &surface, int tabInChars) {
// Ask platform to allocate each unique font.
for (std::pair<const FontSpecification, std::unique_ptr<FontRealised>> &font : fonts) {
- font.second->Realise(surface, zoomLevel, technology, font.first);
+ font.second->Realise(surface, zoomLevel, technology, font.first, localeName.c_str());
}
// Set the platform font handle and measurements for each style.
@@ -400,6 +405,10 @@ void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {
styles[styleIndex].fontName = fontNames.Save(name);
}
+void ViewStyle::SetFontLocaleName(const char *name) {
+ localeName = name;
+}
+
bool ViewStyle::ProtectionActive() const noexcept {
return someStylesProtected;
}