Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/text/font_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class _PolyfillFontManager extends _FontManager {
html.document.body.append(paragraph);
final int sansSerifWidth = paragraph.offsetWidth;

paragraph.style.fontFamily = '$family, sans-serif';
paragraph.style.fontFamily = "'$family', sans-serif";

final Completer<void> completer = Completer<void>();

Expand Down
10 changes: 5 additions & 5 deletions lib/web_ui/lib/src/engine/text/paragraph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ void _applyParagraphStyleToElement({
style._fontStyle == ui.FontStyle.normal ? 'normal' : 'italic';
}
if (style._effectiveFontFamily != null) {
cssStyle.fontFamily = style._effectiveFontFamily;
cssStyle.fontFamily = "'${style._effectiveFontFamily}'";
}
} else {
if (style._textAlign != previousStyle._textAlign) {
Expand All @@ -1098,7 +1098,7 @@ void _applyParagraphStyleToElement({
: null;
}
if (style._fontFamily != previousStyle._fontFamily) {
cssStyle.fontFamily = style._fontFamily;
cssStyle.fontFamily = "'${style._fontFamily}'";
}
}
}
Expand Down Expand Up @@ -1138,11 +1138,11 @@ void _applyTextStyleToElement({
// consistently use Ahem font.
if (isSpan && !ui.debugEmulateFlutterTesterEnvironment) {
if (style._fontFamily != null) {
cssStyle.fontFamily = style._fontFamily;
cssStyle.fontFamily = "'${style._fontFamily}'";
}
} else {
if (style._effectiveFontFamily != null) {
cssStyle.fontFamily = style._effectiveFontFamily;
cssStyle.fontFamily = "'${style._effectiveFontFamily}'";
}
}
if (style._letterSpacing != null) {
Expand Down Expand Up @@ -1176,7 +1176,7 @@ void _applyTextStyleToElement({
: null;
}
if (style._fontFamily != previousStyle._fontFamily) {
cssStyle.fontFamily = style._fontFamily;
cssStyle.fontFamily = "'${style._fontFamily}'";
}
if (style._letterSpacing != previousStyle._letterSpacing) {
cssStyle.letterSpacing = '${style._letterSpacing}px';
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/text/ruler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ParagraphGeometricStyle {
result.write(DomRenderer.defaultFontSize);
}
result.write(' ');
result.write(effectiveFontFamily);
result.write("'$effectiveFontFamily'");

return result.toString();
}
Expand Down Expand Up @@ -227,7 +227,7 @@ class TextDimensions {
void applyStyle(ParagraphGeometricStyle style) {
_element.style
..fontSize = style.fontSize != null ? '${style.fontSize.floor()}px' : null
..fontFamily = style.effectiveFontFamily
..fontFamily = "'${style.effectiveFontFamily}'"
..fontWeight =
style.fontWeight != null ? fontWeightToCss(style.fontWeight) : null
..fontStyle = style.fontStyle != null
Expand Down