本文整理匯總了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;
}