繁体   English   中英

如何为Android应用增加jqMath方程的字体大小

[英]How to increase font size of jqMath equation for Android app

所以这是我的代码:

webView = (WebView) findViewById(R.id.layout_webview);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
String js = "<html><head>"
       + "<link rel='stylesheet' href='file:///android_asset/mathscribe/jqmath-0.4.0.css'>"
       + "<script src = 'file:///android_asset/mathscribe/jquery-1.4.3.min.js'></script>"
       + "<script src = 'file:///android_asset/mathscribe/jqmath-etc-0.4.2.min.js'></script>"
       + "</head><body>"
       + "<script>var s =   '$$x={-b±√{b^2-4ac}}/{2a}$$';M.parseMath(s);document.write(s);</script> </body>";
webView.loadDataWithBaseURL("", js, "text/html", "UTF-8", "");

即使我将fontsize设置为100,无论我将字体大小设置为多少,等式的大小都不会改变。 有没有办法增加等式的字体大小?

目前尚不清楚在何时何地将字体大小设置为100(因为在发布的代码中看不出来)。

根据另一个答案,您应该加载jqmath-xycss 之后设置字体大小以覆盖其包含的值。

尝试在发布代码后在JavaScript中进行设置。 类似于document.body.style.fontSize = "100pt"; 例如,在document.write之后。

 var s = '$$x={-b±√{b^2-4ac}}/{2a}$$'; M.parseMath(s); document.write(s); document.body.style.fontSize = "40pt"; 
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="http://mathscribe.com/mathscribe/jqmath-0.4.0.css" /> <script type="text/javascript" src="http://mathscribe.com/mathscribe/jqmath-etc-0.4.0.min.js"></script> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM