本文整理汇总了Java中android.text.TextPaint.setTextSkewX方法的典型用法代码示例。如果您正苦于以下问题:Java TextPaint.setTextSkewX方法的具体用法?Java TextPaint.setTextSkewX怎么用?Java TextPaint.setTextSkewX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.text.TextPaint
的用法示例。
在下文中一共展示了TextPaint.setTextSkewX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import android.text.TextPaint; //导入方法依赖的package包/类
private void apply(TextPaint paint) {
int oldStyle;
Typeface old = paint.getTypeface();
if (old == null) {
oldStyle = 0;
} else {
oldStyle = old.getStyle();
}
final int fakeStyle = oldStyle & ~typeface.getStyle();
if ((fakeStyle & Typeface.BOLD) != 0) {
paint.setFakeBoldText(true);
}
if ((fakeStyle & Typeface.ITALIC) != 0) {
paint.setTextSkewX(-0.25f);
}
paint.setTypeface(typeface);
}
示例2: setSwitchTypeface
import android.text.TextPaint; //导入方法依赖的package包/类
public void setSwitchTypeface(Typeface tf, int style) {
boolean z = false;
if (style > 0) {
int typefaceStyle;
float f;
if (tf == null) {
tf = Typeface.defaultFromStyle(style);
} else {
tf = Typeface.create(tf, style);
}
setSwitchTypeface(tf);
if (tf != null) {
typefaceStyle = tf.getStyle();
} else {
typefaceStyle = 0;
}
int need = style & (typefaceStyle ^ -1);
TextPaint textPaint = this.mTextPaint;
if ((need & 1) != 0) {
z = true;
}
textPaint.setFakeBoldText(z);
textPaint = this.mTextPaint;
if ((need & 2) != 0) {
f = -0.25f;
} else {
f = 0.0f;
}
textPaint.setTextSkewX(f);
return;
}
this.mTextPaint.setFakeBoldText(false);
this.mTextPaint.setTextSkewX(0.0f);
setSwitchTypeface(tf);
}
示例3: updateMeasureState
import android.text.TextPaint; //导入方法依赖的package包/类
@Override
public void updateMeasureState(TextPaint p) {
p.setTextSkewX(-0.25F);
}
示例4: updateDrawState
import android.text.TextPaint; //导入方法依赖的package包/类
@Override
public void updateDrawState(TextPaint tp) {
tp.setTextSkewX(-0.25F);
}