jlatexmath-android如何实现自定义渲染字符

使用jlatexmath-android的过程,如果出现个别字符渲染不了,会导致无法显示

常用的做法是新增自定义字体+切换系统默认字体渲染,下面我们介绍第2种方法。

修改流程:

1、到jlatexmath-android的官网下载源码到本地,导入到IDE

2、找到这个类JLatexMathDrawable

3、在这个方法做替换操作

public Builder(String latex) {

//把latext里面不支持渲染的公式符号,替换为可见字符。

}

4、找到TeXParser类

5、找到这个方法Atom convertCharacter(char c, boolean oneChar) throws ParseException

6、在方法前面增加这个拦截,哪些字符采用android系统默认字体渲染

//把字符丢进去判断,如果是拦截的字符就自动过滤

if (useJavaFontRenderingAtomChar(c)) {

return new JavaFontRenderingAtom(Character.toString(c), Font.PLAIN);

}

7、请遵循源码的开源协议

相关推荐
alexhilton4 小时前
Android的Agent优先时代:构建时vs运行时
android·kotlin·android jetpack
Cutecat_5 小时前
视频字幕处理工具横向:提取模式 vs 编辑模式,该如何选择
android·前端·ios·语音识别
2601_961765296 小时前
【分享】PlayerPro媒体音乐播放器 完整专业版
android·媒体
JohnnyDeng948 小时前
【Android】Android 包体积优化:R8/ProGuard 深度配置全攻略
android·性能优化·kotlin·jetpack
故渊at8 小时前
第九板块:Android 多媒体体系 | 第二十四篇:Camera Service 与 HAL3 成像流水线
android·camera·多媒体体系·hal3
Jinkxs11 小时前
Python基础 - 初识内置函数 Python自带的便捷工具
android·java·python
私人珍藏库12 小时前
【Android】VLLO-韩国热门手机剪辑APP
android·app·工具·软件·多功能
Cloud_Shy61812 小时前
解读《Effective Python 3rd Edition》:从练气到老魔(第六章 Item 40 - 43)
android·开发语言·人工智能·笔记·python·学习方法
AFinalStone13 小时前
Android12 U盘插拔链路源码全解析(五):Framework层(下) StorageManagerService
android·frameworks
林九生14 小时前
【实用技巧】MySQL 绿色版一键路径更新脚本详解 —— update_path.bat 深度解析
android·数据库·mysql