Created
May 5, 2018 00:21
-
-
Save wypk/32b65eff26f1fd47bef09c97b463e135 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FontChecker { | |
private static FontChecker fontChecker; | |
private FontChecker() { | |
} | |
public static FontChecker getInstance() { | |
if (fontChecker == null) { | |
fontChecker = new FontChecker(); | |
} | |
return fontChecker; | |
} | |
public final boolean isUnicode(Context mContext) { | |
TextView textView = new TextView(mContext, null); | |
textView.setLayoutParams(new ViewGroup.LayoutParams(-2, -2)); | |
textView.setText("က"); | |
textView.measure(-2, -2); | |
int length1 = textView.getMeasuredWidth(); | |
textView.setText("က္က"); | |
textView.measure(-2, -2); | |
int length2 = textView.getMeasuredWidth(); | |
return length1 == length2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment