本文整理汇总了Java中com.caverock.androidsvg.SVG.Style.FontStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Style.FontStyle方法的具体用法?Java Style.FontStyle怎么用?Java Style.FontStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.caverock.androidsvg.SVG.Style
的用法示例。
在下文中一共展示了Style.FontStyle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseFontStyle
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static Style.FontStyle parseFontStyle(String val)
throws SAXException {
Style.FontStyle fs = fontStyleKeyword(val);
if (fs != null)
return fs;
else
throw new SAXException("Invalid font-style property: " + val);
}
示例2: fontStyleKeyword
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static Style.FontStyle fontStyleKeyword(String val) {
// Italic is probably the most common, so test that first :)
if ("italic".equals(val))
return Style.FontStyle.Italic;
else if ("normal".equals(val))
return Style.FontStyle.Normal;
else if ("oblique".equals(val))
return Style.FontStyle.Oblique;
else
return null;
}
示例3: parseFontStyle
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static Style.FontStyle parseFontStyle(String val) throws SAXException {
Style.FontStyle fs = fontStyleKeyword(val);
if (fs != null)
return fs;
else
throw new SAXException("Invalid font-style property: " + val);
}
示例4: fontStyleKeyword
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static Style.FontStyle fontStyleKeyword(String val) {
// Italic is probably the most common, so test that first :)
if ("italic".equals(val))
return Style.FontStyle.Italic;
else if ("normal".equals(val))
return Style.FontStyle.Normal;
else if ("oblique".equals(val))
return Style.FontStyle.Oblique;
else
return null;
}
示例5: parseFontStyle
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static Style.FontStyle parseFontStyle(String val) throws SAXException
{
Style.FontStyle fs = fontStyleKeyword(val);
if (fs != null)
return fs;
else
throw new SAXException("Invalid font-style property: "+val);
}
示例6: fontStyleKeyword
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static Style.FontStyle fontStyleKeyword(String val)
{
// Italic is probably the most common, so test that first :)
if ("italic".equals(val))
return Style.FontStyle.Italic;
else if ("normal".equals(val))
return Style.FontStyle.Normal;
else if ("oblique".equals(val))
return Style.FontStyle.Oblique;
else
return null;
}
示例7: parseFont
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static void parseFont(Style style, String val) throws SAXException {
List<String> fontFamily = null;
Length fontSize = null;
Integer fontWeight = null;
Style.FontStyle fontStyle = null;
String fontVariant = null;
// Start by checking for the fixed size standard system font names
// (which we don't support)
if ("|caption|icon|menu|message-box|small-caption|status-bar|"
.indexOf('|' + val + '|') != -1)
return;
// Fist part: style/variant/weight (opt - one or more)
TextScanner scan = new TextScanner(val);
String item = null;
while (true) {
item = scan.nextToken('/');
scan.skipWhitespace();
if (item == null)
throw new SAXException(
"Invalid font style attribute: missing font size and family");
if (fontWeight != null && fontStyle != null)
break;
if (item.equals("normal")) // indeterminate which of these this
// refers to
continue;
if (fontWeight == null) {
fontWeight = FontWeightKeywords.get(item);
if (fontWeight != null)
continue;
}
if (fontStyle == null) {
fontStyle = fontStyleKeyword(item);
if (fontStyle != null)
continue;
}
// Must be a font-variant keyword?
if (fontVariant == null && item.equals("small-caps")) {
fontVariant = item;
continue;
}
// Not any of these. Break and try next section
break;
}
// Second part: font size (reqd) and line-height (opt)
fontSize = parseFontSize(item);
// Check for line-height (which we don't support)
if (scan.consume('/')) {
scan.skipWhitespace();
item = scan.nextToken();
if (item == null)
throw new SAXException(
"Invalid font style attribute: missing line-height");
parseLength(item);
scan.skipWhitespace();
}
// Third part: font family
fontFamily = parseFontFamily(scan.restOfText());
style.fontFamily = fontFamily;
style.fontSize = fontSize;
style.fontWeight = (fontWeight == null) ? Style.FONT_WEIGHT_NORMAL
: fontWeight;
style.fontStyle = (fontStyle == null) ? Style.FontStyle.Normal
: fontStyle;
style.specifiedFlags |= (SVG.SPECIFIED_FONT_FAMILY
| SVG.SPECIFIED_FONT_SIZE | SVG.SPECIFIED_FONT_WEIGHT | SVG.SPECIFIED_FONT_STYLE);
}
示例8: parseFont
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static void parseFont(Style style, String val) throws SAXException {
List<String> fontFamily = null;
Length fontSize = null;
Integer fontWeight = null;
Style.FontStyle fontStyle = null;
String fontVariant = null;
// Start by checking for the fixed size standard system font names (which we don't support)
if ("|caption|icon|menu|message-box|small-caption|status-bar|".indexOf('|' + val + '|') != -1)
return;
// Fist part: style/variant/weight (opt - one or more)
TextScanner scan = new TextScanner(val);
String item = null;
while (true) {
item = scan.nextToken('/');
scan.skipWhitespace();
if (item == null)
throw new SAXException("Invalid font style attribute: missing font size and family");
if (fontWeight != null && fontStyle != null)
break;
if (item.equals("normal")) // indeterminate which of these this refers to
continue;
if (fontWeight == null) {
fontWeight = FontWeightKeywords.get(item);
if (fontWeight != null)
continue;
}
if (fontStyle == null) {
fontStyle = fontStyleKeyword(item);
if (fontStyle != null)
continue;
}
// Must be a font-variant keyword?
if (fontVariant == null && item.equals("small-caps")) {
fontVariant = item;
continue;
}
// Not any of these. Break and try next section
break;
}
// Second part: font size (reqd) and line-height (opt)
fontSize = parseFontSize(item);
// Check for line-height (which we don't support)
if (scan.consume('/')) {
scan.skipWhitespace();
item = scan.nextToken();
if (item == null)
throw new SAXException("Invalid font style attribute: missing line-height");
parseLength(item);
scan.skipWhitespace();
}
// Third part: font family
fontFamily = parseFontFamily(scan.restOfText());
style.fontFamily = fontFamily;
style.fontSize = fontSize;
style.fontWeight = (fontWeight == null) ? Style.FONT_WEIGHT_NORMAL : fontWeight;
style.fontStyle = (fontStyle == null) ? Style.FontStyle.Normal : fontStyle;
style.specifiedFlags |= (SVG.SPECIFIED_FONT_FAMILY | SVG.SPECIFIED_FONT_SIZE | SVG.SPECIFIED_FONT_WEIGHT | SVG.SPECIFIED_FONT_STYLE);
}
示例9: parseFont
import com.caverock.androidsvg.SVG.Style; //导入方法依赖的package包/类
private static void parseFont(Style style, String val) throws SAXException
{
Integer fontWeight = null;
Style.FontStyle fontStyle = null;
String fontVariant = null;
// Start by checking for the fixed size standard system font names (which we don't support)
if (!"|caption|icon|menu|message-box|small-caption|status-bar|".contains('|'+val+'|'))
return;
// Fist part: style/variant/weight (opt - one or more)
TextScanner scan = new TextScanner(val);
String item;
while (true)
{
item = scan.nextToken('/');
scan.skipWhitespace();
if (item == null)
throw new SAXException("Invalid font style attribute: missing font size and family");
if (fontWeight != null && fontStyle != null)
break;
if (item.equals("normal")) // indeterminate which of these this refers to
continue;
if (fontWeight == null) {
fontWeight = FontWeightKeywords.get(item);
if (fontWeight != null)
continue;
}
if (fontStyle == null) {
fontStyle = fontStyleKeyword(item);
if (fontStyle != null)
continue;
}
// Must be a font-variant keyword?
if (fontVariant == null && item.equals("small-caps")) {
fontVariant = item;
continue;
}
// Not any of these. Break and try next section
break;
}
// Second part: font size (reqd) and line-height (opt)
Length fontSize = parseFontSize(item);
// Check for line-height (which we don't support)
if (scan.consume('/'))
{
scan.skipWhitespace();
item = scan.nextToken();
if (item == null)
throw new SAXException("Invalid font style attribute: missing line-height");
parseLength(item);
scan.skipWhitespace();
}
// Third part: font family
style.fontFamily = parseFontFamily(scan.restOfText());
style.fontSize = fontSize;
style.fontWeight = (fontWeight == null) ? Style.FONT_WEIGHT_NORMAL : fontWeight;
style.fontStyle = (fontStyle == null) ? Style.FontStyle.Normal : fontStyle;
style.specifiedFlags |= (SVG.SPECIFIED_FONT_FAMILY | SVG.SPECIFIED_FONT_SIZE | SVG.SPECIFIED_FONT_WEIGHT | SVG.SPECIFIED_FONT_STYLE);
}