libpalaso icon indicating copy to clipboard operation
libpalaso copied to clipboard

Support New LDML Standard

Open papeh opened this issue 3 years ago • 1 comments

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".

papeh avatar Aug 22 '22 20:08 papeh

I think what needs to happen is:

  • add FontRoles.UI to FontRoles enum
  • add "ui" to the list of font types (in LdmlDataMapper.RoleToFontRoles and LdmlDataMapper.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.

ermshiperete avatar Oct 18 '22 13:10 ermshiperete