libpalaso
libpalaso copied to clipboard
Support New LDML Standard
Presently, SIL.WritingSystems.LdmlDataMapper.ReadLdml handles a finite number of font types. Several LDML files in SLDR (including English) are being updated to include <sil:font name="Noto Sans" types="ui" [ . . . ]/>. We should be able to read them properly (at least without crashing—see LT-21098).
@mhosken (2022-08-16) wrote:
As per the documentation, the @types attribute may take any values, one of which is explicitly stated as being "ui".
I think what needs to happen is:
- add
FontRoles.UItoFontRolesenum - add "ui" to the list of font types (in
LdmlDataMapper.RoleToFontRolesandLdmlDataMapper.FontRolesToRole) - if we encounter a type that is not in the list, we treat it as
{font_type, FontRoles.Default}
We should add unit tests for the two new cases: when we get the value ui and when we get a value that is not in the list.