TF-3933 Avoid load font from google

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-08-01 18:10:56 +07:00
committed by Dat H. Pham
parent 1c04825367
commit 801b08bc90
31 changed files with 352 additions and 277 deletions
@@ -70,7 +70,6 @@ class EditorFullscreenDialogView extends StatelessWidget {
Expanded(
child: IosHtmlContentViewerWidget(
contentHtml: content,
useDefaultFont: true,
direction: AppUtils.getCurrentDirection(context),
),
),
@@ -1,6 +1,6 @@
import 'package:core/presentation/constants/constants_ui.dart';
import 'package:core/utils/html/html_utils.dart';
import 'package:core/utils/html/html_template.dart';
import 'package:core/utils/platform_info.dart';
import 'package:flutter/material.dart';
import 'package:rich_text_composer/rich_text_composer.dart';
@@ -34,9 +34,9 @@ class MobileEditorWidget extends StatelessWidget {
maxHeight: PlatformInfo.isIOS ? ConstantsUI.composerHtmlContentMaxHeight : null,
addDefaultSelectionMenuItems: false,
initialContent: content,
customStyleCss: HtmlUtils.customCssStyleHtmlEditor(
customStyleCss: HtmlTemplate.mobileCustomInternalStyleCSS(
direction: direction,
useDefaultFont: true,
useDefaultFontStyle: true,
),
onCreated: (editorApi) => onCreatedEditorAction.call(context, editorApi, content),
onCompleted: onLoadCompletedEditorAction,
@@ -121,11 +121,14 @@ class _WebEditorState extends State<WebEditorWidget> {
darkMode: false,
cacheHTMLAssetOffline: true,
initialText: widget.content,
customBodyCssStyle: HtmlUtils.customCssStyleHtmlEditor(
customBodyCssStyle: HtmlUtils.customInlineBodyCssStyleHtmlEditor(
direction: widget.direction,
horizontalPadding: widget.horizontalPadding,
),
customInternalCSS: HtmlTemplate.customInternalStyleCSS,
customInternalCSS: HtmlTemplate.webCustomInternalStyleCSS(
useDefaultFontStyle: true,
customScrollbar: true,
),
spellCheck: true,
disableDragAndDrop: true,
webInitialScripts: UnmodifiableListView([