本文整理汇总了Java中android.graphics.Typeface.DEFAULT_BOLD属性的典型用法代码示例。如果您正苦于以下问题:Java Typeface.DEFAULT_BOLD属性的具体用法?Java Typeface.DEFAULT_BOLD怎么用?Java Typeface.DEFAULT_BOLD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.graphics.Typeface
的用法示例。
在下文中一共展示了Typeface.DEFAULT_BOLD属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypeface
private Typeface getTypeface() {
String textTypeface = PreferenceManager.getDefaultSharedPreferences(getBaseContext()).getString("textTypeface", "1");
switch (Integer.parseInt(textTypeface)) {
default:
return Typeface.DEFAULT;
case 2:
return Typeface.DEFAULT_BOLD;
case 3:
return Typeface.MONOSPACE;
case 4:
return Typeface.SANS_SERIF;
case 5:
return Typeface.SERIF;
}
}
示例2: aktivitetOnCreate
public void aktivitetOnCreate(Basisaktivitet ctx) {
ctx.getResources().updateConfiguration(App.sprogKonfig, null);
// Forgrundsinitialisering der skal ske før app'en bliver synlig første gang
// - muligvis aldrig hvis app'en kun betjenes via levende ikon, eller kun er aktiv i baggrunden
if (App.color!=null) return; // initialisering allerede sket
App.color = new DRFarver();
accessibilityManager = (AccessibilityManager) ctx.getSystemService(Context.ACCESSIBILITY_SERVICE); // tager tid i test
skrift_gibson = Typeface.DEFAULT;
skrift_gibson_fed = Typeface.DEFAULT_BOLD;
skrift_georgia = Typeface.SERIF;
skrift_gibson_fed_span = new EgenTypefaceSpan("Gibson fed", App.skrift_gibson_fed);
AppOpdatering.APK_URL = res.getString(R.string.AppOpdatering_APK_URL);
if (!EMULATOR) AppOpdatering.tjekForNyAPK(ctx);
Log.d("onCreate tog " + (System.currentTimeMillis() - TIDSSTEMPEL_VED_OPSTART) + " ms");
}
示例3: getCharGeometryCacheKey
private static int getCharGeometryCacheKey(final char referenceChar, final Paint paint) {
final int labelSize = (int)paint.getTextSize();
final Typeface face = paint.getTypeface();
final int codePointOffset = referenceChar << 15;
if (face == Typeface.DEFAULT) {
return codePointOffset + labelSize;
} else if (face == Typeface.DEFAULT_BOLD) {
return codePointOffset + labelSize + 0x1000;
} else if (face == Typeface.MONOSPACE) {
return codePointOffset + labelSize + 0x2000;
} else {
return codePointOffset + labelSize;
}
}
示例4: selectPreviewTypeface
@NonNull
public Typeface selectPreviewTypeface(final KeyDrawParams params) {
if (previewHasLetterSize()) {
return selectTypeface(params);
}
return Typeface.DEFAULT_BOLD;
}
示例5: createPaint
private Paint createPaint(final boolean bold, final int fontSize) {
final Typeface typeface = (bold) ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT;
return new Paint()
{{
setARGB(255, 255, 255, 255);
setTextSize(fontSize);
setTypeface(typeface);
setAntiAlias(true);
}};
}
示例6: selectPreviewTypeface
@Nonnull
public Typeface selectPreviewTypeface(final KeyDrawParams params) {
if (previewHasLetterSize()) {
return selectTypeface(params);
}
return Typeface.DEFAULT_BOLD;
}
示例7: getTextTypeface
private static Typeface getTextTypeface(@Nullable final CharSequence text) {
return hasStyleSpan(text, BOLD_SPAN) ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT;
}