You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: lib/ui/text.dart
+39-12Lines changed: 39 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,7 @@ Int32List _encodeTextStyle(
256
256
double letterSpacing,
257
257
double wordSpacing,
258
258
double height,
259
+
Locale locale,
259
260
) {
260
261
finalInt32List result =newInt32List(8);
261
262
if (color !=null) {
@@ -306,6 +307,10 @@ Int32List _encodeTextStyle(
306
307
result[0] |=1<<12;
307
308
// Passed separately to native.
308
309
}
310
+
if (locale !=null) {
311
+
result[0] |=1<<13;
312
+
// Passed separately to native.
313
+
}
309
314
return result;
310
315
}
311
316
@@ -325,6 +330,7 @@ class TextStyle {
325
330
/// * `wordSpacing`: The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word).
326
331
/// * `textBaseline`: The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box.
327
332
/// * `height`: The height of this text span, as a multiple of the font size.
333
+
/// * `locale`: The locale used to select region-specific glyphs.
328
334
TextStyle({
329
335
Color color,
330
336
TextDecoration decoration,
@@ -338,6 +344,7 @@ class TextStyle {
338
344
double letterSpacing,
339
345
double wordSpacing,
340
346
double height,
347
+
Locale locale,
341
348
}) : _encoded =_encodeTextStyle(
342
349
color,
343
350
decoration,
@@ -351,19 +358,22 @@ class TextStyle {
351
358
letterSpacing,
352
359
wordSpacing,
353
360
height,
361
+
locale,
354
362
),
355
363
_fontFamily = fontFamily ??'',
356
364
_fontSize = fontSize,
357
365
_letterSpacing = letterSpacing,
358
366
_wordSpacing = wordSpacing,
359
-
_height = height;
367
+
_height = height,
368
+
_locale = locale;
360
369
361
370
finalInt32List _encoded;
362
371
finalString _fontFamily;
363
372
finaldouble _fontSize;
364
373
finaldouble _letterSpacing;
365
374
finaldouble _wordSpacing;
366
375
finaldouble _height;
376
+
finalLocale _locale;
367
377
368
378
@override
369
379
booloperator==(dynamic other) {
@@ -376,7 +386,8 @@ class TextStyle {
376
386
_fontSize != typedOther._fontSize ||
377
387
_letterSpacing != typedOther._letterSpacing ||
378
388
_wordSpacing != typedOther._wordSpacing ||
379
-
_height != typedOther._height)
389
+
_height != typedOther._height ||
390
+
_locale != typedOther._locale)
380
391
returnfalse;
381
392
for (int index =0; index < _encoded.length; index +=1) {
382
393
if (_encoded[index] != typedOther._encoded[index])
0 commit comments