TextPaint.java revision 9066cfe9886ac131c34d59ed0e2d287b0e3c0087
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
31    public TextPaint() {
32        super();
33    }
34
35    public TextPaint(int flags) {
36        super(flags);
37    }
38
39    public TextPaint(Paint p) {
40        super(p);
41    }
42
43    /**
44     * Copy the fields from tp into this TextPaint, including the
45     * fields inherited from Paint.
46     */
47    public void set(TextPaint tp) {
48        super.set(tp);
49
50        bgColor = tp.bgColor;
51        baselineShift = tp.baselineShift;
52        linkColor = tp.linkColor;
53        drawableState = tp.drawableState;
54    }
55}
56