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