TextPaint.java revision a9f1dd021f8f6ee777bc4d27913bd40c42e753af
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.text;
18
19import android.graphics.Paint;
20
21/**
22 * TextPaint is an extension of Paint that leaves room for some extra
23 * data used during text measuring and drawing.
24 */
25public class TextPaint extends Paint {
26    public int bgColor;
27    public int baselineShift;
28    public int linkColor;
29    public int[] drawableState;
30    public float density = 1.0f;
31
32    public TextPaint() {
33        super();
34    }
35
36    public TextPaint(int flags) {
37        super(flags);
38    }
39
40    public TextPaint(Paint p) {
41        super(p);
42    }
43
44    /**
45     * Copy the fields from tp into this TextPaint, including the
46     * fields inherited from Paint.
47     */
48    public void set(TextPaint tp) {
49        super.set(tp);
50
51        bgColor = tp.bgColor;
52        baselineShift = tp.baselineShift;
53        linkColor = tp.linkColor;
54        drawableState = tp.drawableState;
55        density = tp.density;
56    }
57}
58