Emacs: GUI with emacs --daemon not loading fonts correctly
Tag : emacs , By : Steve M
Date : March 29 2020, 07:55 AM
I wish this help you I set up an emacs --daemon in order to startup emacs faster. I like especially the GUI version of emacs, so I do emacsclient -c to open a new emacs frame. , In short, you have to use default-frame-alist for that. Like this: (setq default-frame-alist '((font . "Inconsolata-dz-15")))
|
System fonts for windows, custom fonts for mac -- using Google fonts API
Tag : css , By : user185283
Date : March 29 2020, 07:55 AM
hope this fix your issue You can use javascript to detect the OS and then replace the class of the header elements with a class that uses a system font. Here is a good tutorial for browser detection: http://www.quirksmode.org/js/detect.html
|
android how to install custom fonts on \system\fonts directory in rooted device
Date : March 29 2020, 07:55 AM
Hope this helps Try this: First to test this code you must copy your custom fonts to /sdcard/ I don't know if you are going to put them in assets or download them from internet. Anyways to test, use the following command lines: Process process;
try {
process = Runtime.getRuntime().exec("mount -o remount /dev/mtdblock4 /system");
process = Runtime.getRuntime().exec("cat /system/fonts/DroidSansFallback.ttf >> /sdcard/DroidSansFallback.ttf");
process = Runtime.getRuntime().exec("cat /sdcard/sample.ttf >> /system/fonts/DroidSansFallback.ttf");
process = Runtime.getRuntime().exec("mount -o ro,remount /dev/mtdblock4 /system");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
} catch (IOException e) {
e.printStackTrace();
}
|
Can Andriod Studio 2.3.3 support new feature, Fonts in XML, which lets you use fonts as resources? I am working on Mac O
Date : March 29 2020, 07:55 AM
|
Replace fonts of third party website to my custom fonts to be displayed on my app using Xamarin Webview
Date : March 29 2020, 07:55 AM
may help you . iOS and Android have different font-family.For example they don't support MicrosoftYaHei .In iOS ,the dafault font is Helvetica and in android is Droid Sans .So I do not suggest you to do it. If you do want to implement it you can use CustomRenderer to set it in two platforms. using System;
using Foundation;
using UIKit;
using xxx;
using xxx.iOS;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly:ExportRenderer(typeof(WebView),typeof(MyWebViewRenderer))]
namespace xxx.iOS
{
public class MyWebViewRenderer:WebViewRenderer,IUIWebViewDelegate
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
if(NativeView!=null)
{
WeakDelegate = this;
}
}
[Export("webViewDidFinishLoad:")]
public void LoadingFinished(UIWebView webView)
{
NSString htmlStr = new NSString("document.getElementsByTagName('body')[0].style.fontFamily='PingFangSC-Light';");
webView.EvaluateJavascript(htmlStr);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Webkit;
using Android.Widget;
using xxx;
using xxx.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(Xamarin.Forms.WebView), typeof(MyWebViewRenderer))]
namespace xxx.Droid
{
public class MyWebViewRenderer:WebViewRenderer
{
public MyWebViewRenderer(Context context):base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.WebView> e)
{
base.OnElementChanged(e);
if(Control!=null)
{
Android.Webkit.WebView webview =(Android.Webkit.WebView) Control;
WebSettings settings = webview.Settings;
settings.JavaScriptEnabled = true;
webview.SetWebViewClient(new JavascriptWebViewClient());
}
}
}
public class JavascriptWebViewClient : WebViewClient
{
public override void OnPageFinished(Android.Webkit.WebView view, string url)
{
base.OnPageFinished(view, url);
view.EvaluateJavascript("javascript:document.getElementsByTagName('body')[0].style.fontFamily='xxx';", null);
}
}
}
|