@@ -162,11 +162,17 @@ void Buffer_::SetLocale(const char* locale)
162
162
163
163
std::string str = reinterpret_cast <const char *>(locale);
164
164
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t >> converter;
165
- std::wstring openTypeLocale = converter.from_bytes (str);
165
+ std::wstring inputLocale = converter.from_bytes (str);
166
166
167
- std::wstring windowsLocale;
168
- if (localeMap_->GetWindowsLocale (openTypeLocale, windowsLocale))
167
+ std::wstring windowsLocale;
168
+ if (localeMap_->GetWindowsLocale (inputLocale, windowsLocale))
169
+ {
169
170
locale_ = windowsLocale;
171
+ }
172
+ else
173
+ {
174
+ locale_ = inputLocale;
175
+ }
170
176
}
171
177
172
178
const char * Buffer_::GetLocale ()
@@ -329,7 +335,7 @@ bool Font_::SetFeatures(uint32_t textLength, const std::vector<hb_feature_t>& f
329
335
330
336
// look though features and determine range boundries
331
337
for (auto & it : features)
332
- {
338
+ {
333
339
if (it.start < featureRangeBounderies.size ())
334
340
{
335
341
featureRangeBounderies[it.start ] = true ;
@@ -381,7 +387,7 @@ bool Font_::SetFeatures(uint32_t textLength, const std::vector<hb_feature_t>& f
381
387
// allocate an array for DWRITE_FONT_FEATURE
382
388
DWRITE_FONT_FEATURE* pLocalFeatures = new DWRITE_FONT_FEATURE[localFeatures.size ()];
383
389
for (int j = 0 ; j < localFeatures.size (); j++)
384
- {
390
+ {
385
391
pLocalFeatures[j].nameTag = localFeatures[j].nameTag ;
386
392
pLocalFeatures[j].parameter = localFeatures[j].parameter ;
387
393
}
@@ -394,15 +400,15 @@ bool Font_::SetFeatures(uint32_t textLength, const std::vector<hb_feature_t>& f
394
400
395
401
// Calculate featureRangeLengths
396
402
if (i > 0 )
397
- {
403
+ {
398
404
featureRangeLengths.push_back (featureRangeLength);
399
405
featureRangeLength = 0 ;
400
406
}
401
407
}
402
408
403
409
featureRangeLength++;
404
410
}
405
-
411
+
406
412
// Final length
407
413
featureRangeLengths.push_back (featureRangeLength);
408
414
featureRangeLength = 0 ;
0 commit comments