Open GoogleCodeExporter opened 9 years ago
See item text of:
http://dev.w3.org/html5/2dcontext/#dom-context-2d-font
Sample:
context.font = 'italic 400 12px/2 Unknown Font, sans-serif';
Original comment by thiago.adams
on 2 Feb 2012 at 12:53
Original comment by thiago.adams
on 2 Feb 2012 at 12:58
Thanks for linking to the specification, I will get right on this.
Original comment by jpn.s...@gmail.com
on 2 Feb 2012 at 9:21
LL1 grammar
module FontShorthand
{
language FontShorthand
{
interleave BLANKS = ' '+;
token Normal = "normal";
token Italic = "italic";
token Oblique = "oblique";
token Bold = "bold";
token xxsmall = "xx-small";
token xsmall = "x-small";
token small = "small";
token medium = "medium";
token large = "large";
token xlarge = "x-large";
token xxlarge = "xx-large";
token larger = "larger";
token smaller = "smaller";
token A100 = "100";
token A200 = "200";
token A300 = "300";
token A400 = "400";
token A500 = "500";
token A600 = "600";
token A700 = "700";
token A800 = "800";
token A900 = "900";
token Percent = ('0'..'9')+ "%";
token Points = ('0'..'9')+ "pt";
token Pixels = ('0'..'9')+ "px";
token FontName = ('A'..'Z' | 'a'..'z' | '-' )+;
syntax Main = FontStyleGroup FontSize FontName {SetFontName};
syntax FontStyleGroup = FontStyle FontWeight;
syntax FontStyle = "normal" {SetNormalStyle} | "italic" {SetItalic} | "oblique" {SetOblique} | empty {SetNormalStyle};
syntax FontWeight = "normal" {SetNormalWeight}
| "bold" {SetWeightBold}
| "100" {SetWeight100}
| "200" {SetWeight200}
| "300" {SetWeight300}
| "400" {SetWeight400}
| "500" {SetWeight500}
| "600" {SetWeight600}
| "700" {SetWeight700}
| "800" {SetWeight800}
| "900" {SetWeight900}
| empty {SetNormalWeight};
syntax FontSize = RelativeSize | AbsoluteSize | Percent {SetSizePercent}| Points {SetSizePoints}| Pixels {SetSizePixels};
syntax RelativeSize = "larger" {SetSizeLarger}| "smaller" {SetSizeSmaller};
syntax AbsoluteSize = "xx-small" {SetSizexxsmall}|
"x-small" {SetSizexsmall}|
"small" {SetSizesmall}|
"medium" {SetSizemedium}|
"large" {SetSizelarge}|
"x-large" {SetSizexlarge}|
"xx-large" {SetSizexxlarge};
}
}
Original comment by thiago.adams
on 6 Mar 2012 at 7:57
Original issue reported on code.google.com by
thiago.adams
on 2 Feb 2012 at 12:51