160 |
return name; |
return name; |
161 |
} |
} |
162 |
|
|
163 |
protected static void copyStyleToAttrs (int style, Map attrs) |
public static void copyStyleToAttrs (int style, Map attrs) |
164 |
{ |
{ |
165 |
if ((style & Font.BOLD) == Font.BOLD) |
if ((style & Font.BOLD) == Font.BOLD) |
166 |
attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD); |
attrs.put (TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD); |
179 |
attrs.put (TextAttribute.FAMILY, fam); |
attrs.put (TextAttribute.FAMILY, fam); |
180 |
} |
} |
181 |
|
|
182 |
protected static void copySizeToAttrs (float size, Map attrs) |
public static void copySizeToAttrs (float size, Map attrs) |
183 |
{ |
{ |
184 |
attrs.put (TextAttribute.SIZE, new Float (size)); |
attrs.put (TextAttribute.SIZE, new Float (size)); |
185 |
} |
} |
218 |
AffineTransform trans = this.transform; |
AffineTransform trans = this.transform; |
219 |
float size = this.size; |
float size = this.size; |
220 |
int style = this.style; |
int style = this.style; |
221 |
|
|
222 |
if (attribs.containsKey (TextAttribute.FAMILY)) |
if (attribs.containsKey (TextAttribute.FAMILY)) |
223 |
family = (String) attribs.get (TextAttribute.FAMILY); |
family = (String) attribs.get (TextAttribute.FAMILY); |
224 |
|
|
243 |
{ |
{ |
244 |
Float sz = (Float) attribs.get (TextAttribute.SIZE); |
Float sz = (Float) attribs.get (TextAttribute.SIZE); |
245 |
size = sz.floatValue (); |
size = sz.floatValue (); |
246 |
|
|
247 |
|
// Pango doesn't accept 0 as a font size. |
248 |
|
if (size < 1) |
249 |
|
size = 1; |
250 |
} |
} |
251 |
|
else |
252 |
|
size = 12; |
253 |
|
|
254 |
if (attribs.containsKey (TextAttribute.TRANSFORM)) |
if (attribs.containsKey (TextAttribute.TRANSFORM)) |
255 |
{ |
{ |