Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "i" with same function as "italic" in font spec #13

Merged
merged 2 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ the terms.
This script accepts an arbitrary number of font specs. A font spec consists
of a font name as accepted by Google's servers, optionally followed by
a colon, an optional font weight in numbers or the string "bold" and an
optional font style of "italic" for italics. In [EBNF](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form):
optional font style of "italic" (or "i") for italics. In [EBNF](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form):

```ebnf
fontspec = fontname, [ ":", [ fontweight ], [ fontstyle ] ]
fontweight = number | "bold"
number = { digit }
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
fontstyle = "italic"
fontstyle = "italic" | "i"
```

While Google's servers will accept other inputs and abbreviations for font
Expand Down
2 changes: 1 addition & 1 deletion google-font-download
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ for family in "${families[@]}"; do
# Extract name, Windows-safe filename, font style and font weight from the font family name
fontname=$(echo "$family" | awk -F : '{print $1}')
fontnameescaped=$(echo "$family" | $ESED 's/( |:)/_/g')
fontstyle=$(echo "$family" | awk -F : '{print $2}')
fontstyle=$(echo "$family" | $ESED 's/i$/italic/g' | awk -F : '{print $2}')
fontweight=$(echo "$fontstyle" | $ESED 's/italic$//g')

numfontweight=$(echo "$fontweight" | tr -Cd ',')
Expand Down