mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-25 02:28:35 +00:00
fix(article): fix Opus article body font size too small (#1897)
New Opus format uses font_level string instead of numeric font_size, causing font size to fall back to Flutter theme default (14px) instead of the expected 16px. Added Word.effectiveFontSize: small→13px, others→16px (consistent with legacy HTML article format).
This commit is contained in:
@@ -134,6 +134,13 @@ class Word {
|
|||||||
);
|
);
|
||||||
fontLevel = json['font_level'];
|
fontLevel = json['font_level'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// font_level 映射处理:
|
||||||
|
// "small" → 13px
|
||||||
|
// "regular" → 16px(与旧版 HTML 专栏基准一致)
|
||||||
|
// 其余/null → 同 regular
|
||||||
|
double get effectiveFontSize =>
|
||||||
|
fontSize ?? (fontLevel == 'small' ? 13.0 : 16.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
class Style {
|
class Style {
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class OpusContent extends StatelessWidget {
|
|||||||
style: _getStyle(
|
style: _getStyle(
|
||||||
word?.style,
|
word?.style,
|
||||||
color ?? defaultColor,
|
color ?? defaultColor,
|
||||||
word?.fontSize,
|
word?.effectiveFontSize,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user