android.graphics.Paint#setTextSkewX ( )源码实例Demo

下面列出了android.graphics.Paint#setTextSkewX ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: speech-android-sdk   文件: CustomTypefaceSpan.java
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码2 项目: android_9.0.0_r45   文件: TypefaceSpan.java
private void applyFontFamily(@NonNull Paint paint, @NonNull String family) {
    int style;
    Typeface old = paint.getTypeface();
    if (old == null) {
        style = Typeface.NORMAL;
    } else {
        style = old.getStyle();
    }
    final Typeface styledTypeface = Typeface.create(family, style);
    int fake = style & ~styledTypeface.getStyle();

    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }
    paint.setTypeface(styledTypeface);
}
 
源代码3 项目: AndroidWallet   文件: SpannableStringUtils.java
private static void apply(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码4 项目: mimi-reader   文件: CodeSpan.java
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码5 项目: Newslly   文件: CustomTypefaceSpan.java
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码6 项目: Zom-Android-XMPP   文件: CustomTypefaceSpan.java
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
       int oldStyle;
       Typeface old = paint.getTypeface();
       if (old == null) {
           oldStyle = 0;
       } else {
           oldStyle = old.getStyle();
       }

if (tf != null)
{
       	int fake = oldStyle & tf.getStyle();
       	if ((fake & Typeface.BOLD) != 0) {
           		paint.setFakeBoldText(true);
       	}

       	if ((fake & Typeface.ITALIC) != 0) {
           		paint.setTextSkewX(-0.25f);
       	}

       	paint.setTypeface(tf);
}
   }
 
源代码7 项目: glimmr   文件: TextUtils.java
private void applyCustomTypeface(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }
    paint.setTypeface(tf);
}
 
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码9 项目: DeviceInfo   文件: CustomTypefaceSpan.java
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码10 项目: AndroidUtilCode   文件: SpanUtils.java
private void apply(final Paint paint, final Typeface tf) {
    int oldStyle;
    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.getShader();

    paint.setTypeface(tf);
}
 
源代码11 项目: BaseProject   文件: CircleProgressView.java
private void initPaint() {
    mTextPaint = new Paint();
    mTextPaint.setColor(mTextColor);
    mTextPaint.setStyle(Paint.Style.FILL);
    mTextPaint.setTextSize(mTextSize);
    mTextPaint.setTextSkewX(mTextSkewX);
    mTextPaint.setAntiAlias(true);

    mNormalPaint = new Paint();
    mNormalPaint.setColor(mNormalBarColor);
    mNormalPaint.setStyle(mProgressStyle == ProgressStyle.FILL_IN_ARC ? Paint.Style.FILL : Paint.Style.STROKE);
    mNormalPaint.setAntiAlias(true);
    mNormalPaint.setStrokeWidth(mNormalBarSize);

    mReachPaint = new Paint();
    mReachPaint.setColor(mReachBarColor);
    mReachPaint.setStyle(mProgressStyle == ProgressStyle.FILL_IN_ARC ? Paint.Style.FILL : Paint.Style.STROKE);
    mReachPaint.setAntiAlias(true);
    mReachPaint.setStrokeCap(mReachCapRound ? Paint.Cap.ROUND : Paint.Cap.BUTT);
    mReachPaint.setStrokeWidth(mReachBarSize);

    if (needDrawInnerBackground) {
        mInnerBackgroundPaint = new Paint();
        mInnerBackgroundPaint.setStyle(Paint.Style.FILL);
        mInnerBackgroundPaint.setAntiAlias(true);
        mInnerBackgroundPaint.setColor(mInnerBackgroundColor);
    }
    if (mProgressStyle == ProgressStyle.FILL_IN_ARC) {
        mOutPaint = new Paint();
        mOutPaint.setStyle(Paint.Style.STROKE);
        mOutPaint.setColor(mOuterColor);
        mOutPaint.setStrokeWidth(mOuterSize);
        mOutPaint.setAntiAlias(true);
    }
}
 
源代码12 项目: FairEmail   文件: HtmlHelper.java
private static void applyCustomTypeFace(Paint paint, Typeface tf) {
    Typeface old = paint.getTypeface();
    int oldStyle = (old == null ? 0 : old.getStyle());
    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0)
        paint.setFakeBoldText(true);
    if ((fake & Typeface.ITALIC) != 0)
        paint.setTextSkewX(-0.25f);
    paint.setTypeface(tf);
}
 
源代码13 项目: starcor.xul   文件: XulBasicTextRenderer.java
protected Paint _getTextPaint(float fontSizeScale) {
	XulRenderContext ctx = _render.getRenderContext();
	Paint defPaint = ctx.getTextPaintByName(_fontFace);

	if (!(_fontShadowSize == 0 || (_fontShadowColor & 0xFF000000) == 0)) {
		defPaint = ctx.getShadowTextPaintByName(_fontFace);
		defPaint.setShadowLayer(_fontShadowSize, _fontShadowX, _fontShadowY, _fontShadowColor);
	}

	defPaint.setColor(_fontColor);
	if (Math.abs(fontSizeScale - 1.0f) > 0.01f) {
		defPaint.setTextSize(_fontSize * fontSizeScale);
	} else {
		defPaint.setTextSize(_fontSize);
	}

	if (_fontWeight > 1.0) {
		if (_fontWeight > 2.5) {
			defPaint.setStrokeWidth(_fontWeight*fontSizeScale/2);
		} else {
			defPaint.setFakeBoldText(true);
		}
	} else {
		defPaint.setFakeBoldText(false);
	}
	defPaint.setTextScaleX(_fontScaleX);
	defPaint.setUnderlineText(_fontUnderline);
	defPaint.setStrikeThruText(_fontStrikeThrough);
	defPaint.setTextSkewX(_fontItalic ? -0.25f : 0);
	defPaint.setTextAlign(Paint.Align.LEFT);
	return defPaint;
}
 
源代码14 项目: JotaTextEditor   文件: StyleSpan.java
private static void apply(Paint paint, int style) {
    int oldStyle;

    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int want = oldStyle | style;

    Typeface tf;
    if (old == null) {
        tf = Typeface.defaultFromStyle(want);
    } else {
        tf = Typeface.create(old, want);
    }

    int fake = want & ~tf.getStyle();

    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码15 项目: memetastic   文件: FontPreferenceCompat.java
private void apply(final Paint paint) {
    final Typeface oldTypeface = paint.getTypeface();
    final int oldStyle = oldTypeface != null ? oldTypeface.getStyle() : 0;
    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);
}
 
源代码16 项目: UltimateAndroid   文件: CalligraphyTypefaceSpan.java
private void apply(final Paint paint) {
    final Typeface oldTypeface = paint.getTypeface();
    final int oldStyle = oldTypeface != null ? oldTypeface.getStyle() : 0;
    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);
}
 
源代码17 项目: Android-RTEditor   文件: TypefaceSpan.java
private void applyCustomTypeFace(Paint paint, Typeface tf) {
    Typeface old = paint.getTypeface();
    int oldStyle = old == null ? 0 : old.getStyle();

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码18 项目: RichEditor   文件: HeadSpan.java
private static void applyStyle(Paint paint) {
    int style = Typeface.BOLD;
    int oldStyle;

    Typeface old = paint.getTypeface();
    if (old == null) {
        oldStyle = 0;
    } else {
        oldStyle = old.getStyle();
    }

    int want = oldStyle | style;

    Typeface tf;
    if (old == null) {
        tf = Typeface.defaultFromStyle(want);
    } else {
        tf = Typeface.create(old, want);
    }

    int fake = want & ~tf.getStyle();

    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}
 
源代码19 项目: UltimateAndroid   文件: CalligraphyTypefaceSpan.java
private void apply(final Paint paint) {
    final Typeface oldTypeface = paint.getTypeface();
    final int oldStyle = oldTypeface != null ? oldTypeface.getStyle() : 0;
    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);
}
 
源代码20 项目: memoir   文件: TypefaceSpan.java
private void applyCustomTypeFace(Paint paint, Typeface tf) {
    Typeface old = paint.getTypeface();
    int oldStyle = old == null ? 0 : old.getStyle();

    int fake = oldStyle & ~tf.getStyle();
    if ((fake & Typeface.BOLD) != 0) {
        paint.setFakeBoldText(true);
    }

    if ((fake & Typeface.ITALIC) != 0) {
        paint.setTextSkewX(-0.25f);
    }

    paint.setTypeface(tf);
}