本文整理了Java中android.graphics.Typeface.isItalic()
方法的一些代码示例,展示了Typeface.isItalic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Typeface.isItalic()
方法的具体详情如下:
包路径:android.graphics.Typeface
类名称:Typeface
方法名:isItalic
暂无
代码示例来源:origin: square/assertj-android
public TypefaceAssert isItalic() {
isNotNull();
assertThat(actual.isItalic()) //
.overridingErrorMessage("Expected to be italic but was not.") //
.isTrue();
return this;
}
代码示例来源:origin: square/assertj-android
public TypefaceAssert isNotItalic() {
isNotNull();
assertThat(actual.isItalic()) //
.overridingErrorMessage("Expected to not be italic but was.") //
.isFalse();
return this;
}
}
代码示例来源:origin: facebook/facebook-android-sdk
textStyle.put(TEXT_SIZE, textView.getTextSize());
textStyle.put(TEXT_IS_BOLD, typeface.isBold());
textStyle.put(TEXT_IS_ITALIC, typeface.isItalic());
json.put(TEXT_STYLE, textStyle);
代码示例来源:origin: ankidroid/Anki-Android
attributes.add("font-weight: normal;");
if (tf.isItalic() || name.toLowerCase(Locale.US).contains("italic")) {
attributes.add("font-style: italic;");
family = family.replaceFirst("(?i)-?Italic", "");
代码示例来源:origin: org.arakhne.afc.ui/vector-android
@Override
public boolean isItalic() {
Typeface tf = this.paint.getTypeface();
if (tf==null) tf = Typeface.DEFAULT;
return tf.isItalic();
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public TypefaceAssert isNotItalic() {
isNotNull();
assertThat(actual.isItalic()) //
.overridingErrorMessage("Expected to not be italic but was.") //
.isFalse();
return this;
}
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public TypefaceAssert isItalic() {
isNotNull();
assertThat(actual.isItalic()) //
.overridingErrorMessage("Expected to be italic but was not.") //
.isTrue();
return this;
}
代码示例来源:origin: org.arakhne.afc.ui/vector-android
@Override
public boolean isPlain() {
Typeface tf = this.paint.getTypeface();
if (tf==null) tf = Typeface.DEFAULT;
return !tf.isBold() && !tf.isItalic();
}
代码示例来源:origin: MarcinOrlowski/Fonty
} else if (currentTypeface.isItalic()) {
key = Fonty.TYPE_ITALIC;
if (typefaceFallback) {
代码示例来源:origin: openmrs/openmrs-contrib-android-client
private static void setTypeface(TextView textView) {
if (textView != null) {
if (textView.getTypeface() != null && textView.getTypeface().isBold()
&& textView.getTypeface().isItalic()) {
textView.setTypeface(getOpenTypeface(OpenFonts.OPEN_SANS_BOLD_ITALIC));
} else if (textView.getTypeface() != null && textView.getTypeface().isItalic()) {
textView.setTypeface(getOpenTypeface(OpenFonts.OPEN_SANS_ITALIC));
} else if (textView.getTypeface() != null && textView.getTypeface().isBold()) {
textView.setTypeface(getOpenTypeface(OpenFonts.OPEN_SANS_BOLD));
} else {
textView.setTypeface(getOpenTypeface(OpenFonts.OPEN_SANS_REGULAR));
}
}
}
代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-android-utilities
private void computeFontSize (int width)
{
if (getTypeface().isItalic())
{
scale = 0.5f;
}
final String text = getText().toString();
width -= getPaddingLeft() + getPaddingRight();
float textWidth = getPaint().measureText(text);
for (double s = 0.95f; s >= 0.1f; s -= 0.1f)
{
setTextSize((float)Math.floor((scale * s * getTextSize() * width) / textWidth));
textWidth = getPaint().measureText(text);
// System.err.println("SCALE " + scale + " TEXT WIDTH " + textWidth + " vs " + width);
if (textWidth < Math.floor(scale * width))
{
break;
}
}
}
}
代码示例来源:origin: googleads/googleads-mobile-android-mediation
Bundle typefaceBundle = new Bundle();
typefaceBundle.putBoolean(KEY_IS_BOLD, typeface.isBold());
typefaceBundle.putBoolean(KEY_IS_ITALIC, typeface.isItalic());
typefaceBundle.putInt(KEY_STYLE, typeface.getStyle());
attributesBundle.putBundle(KEY_TYPEFACE, typefaceBundle);
内容来源于网络,如有侵权,请联系作者删除!