Commit Graph

3 Commits

Author SHA1 Message Date
bungeman
c0727d117e Trim whitespace from parsed filename in Android v21.
The entire text content of the 'font' element is currently used as the
file name. This wasn't an issue in earlier versions, as the 'file'
element was dedicated to only containing the file name. The new 'font'
element also contains a number of attributes and potentially other tags.
This means that a 'font' element can become quite long, making it
desireable to be able to split it across multiple lines.

However, splitting the 'font' element across multiple lines is currently
difficult and awkward as any whitespace outside of tags will be
considered part of the file name. This change means that any leading or
trailing whitespace will not be considered part of the file name.

This only applies to v21 and later files, so while this restricts font
file names from beginning and ending with whitespace, it is unlikely to
break any users in practice. It is probably also undesireable to have
font files with names that begin or end with whitespace in any event.

Review URL: https://codereview.chromium.org/1125413003
2015-05-08 08:31:54 -07:00
bungeman
c3c694342a Fix append_fallback_font_families_for_locale.
The language was being set to garbage, now set to part of the file name.
Add a test to ensure we continue to parse fallback directories correctly.

BUG=chromium:422180

Review URL: https://codereview.chromium.org/912053003
2015-02-11 07:18:51 -08:00
tomhudson
f79673bbae Test and generalize font configuration parser
Add a basic unit test for the Android font configuration parser.
Add a check for the new LMP file format; on detection, switch to a new
(as-yet unwritten) parser.

R=bungeman@google.com, djsollen@google.com, tomhudson@google.com

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/439813002
2014-08-05 06:36:14 -07:00