diff --git a/commet/lib/ui/atoms/code_block.dart b/commet/lib/ui/atoms/code_block.dart index 14a34b1d..df931d52 100644 --- a/commet/lib/ui/atoms/code_block.dart +++ b/commet/lib/ui/atoms/code_block.dart @@ -102,7 +102,9 @@ class Codeblock extends StatelessWidget { text.trim(), language: language, theme: theme, - textStyle: const TextStyle(fontFamily: "Code"), + textStyle: const TextStyle( + fontFamily: "Code", + fontFeatures: [FontFeature.disable("calt")]), ) : Text( text.trim(), diff --git a/commet/lib/ui/atoms/rich_text/matrix_html_parser.dart b/commet/lib/ui/atoms/rich_text/matrix_html_parser.dart index 85468444..972192e7 100644 --- a/commet/lib/ui/atoms/rich_text/matrix_html_parser.dart +++ b/commet/lib/ui/atoms/rich_text/matrix_html_parser.dart @@ -269,7 +269,10 @@ class CodeHtmlExtension extends HtmlExtension { return TextSpan( text: context.node.text, - style: TextStyle(fontFamily: "Code", color: color)); + style: TextStyle( + fontFamily: "Code", + color: color, + fontFeatures: const [FontFeature.disable("calt")])); } static const Set tags = {"code"}; diff --git a/commet/lib/ui/atoms/rich_text_field.dart b/commet/lib/ui/atoms/rich_text_field.dart index ccb7242b..0aee9950 100644 --- a/commet/lib/ui/atoms/rich_text_field.dart +++ b/commet/lib/ui/atoms/rich_text_field.dart @@ -80,12 +80,16 @@ class RichTextEditingController extends TextEditingController { var color = Theme.of(context).extension()?.codeHighlight ?? Theme.of(context).colorScheme.primary; - style = style.copyWith(color: color, fontFamily: "code"); + style = style.copyWith( + color: color, + fontFamily: "code", + fontFeatures: const [FontFeature.disable("calt")]); break; case "pre": style = style.copyWith( color: Theme.of(context).colorScheme.surfaceContainerHighest, - fontFamily: "code"); + fontFamily: "code", + fontFeatures: const [FontFeature.disable("calt")]); break; case "a": style = style.copyWith(color: Theme.of(context).colorScheme.primary);