servo / font-kit

A cross-platform font loading library written in Rust
Apache License 2.0
678 stars 100 forks source link

Fix panic when parsing invalid `usWidthClass` #189

Closed CryZe closed 2 years ago

CryZe commented 2 years ago

The code here just trusted the value to always to be valid, but since this may be an arbitrary font, the value may not always be valid. In my case the usWidthClass I'm seeing has the value 500, probably the usWeightClass accidentally being assigned to the usWidthClass.

jdm commented 2 years ago

@bors-servo r+

bors-servo commented 2 years ago

:pushpin: Commit bd6b39d has been approved by jdm

bors-servo commented 2 years ago

:hourglass: Testing commit bd6b39d3d82330a5da313d427a2e4d8deade2373 with merge 59213db4fe2458eefc79ea8b39f17c9b5e046c1e...

bors-servo commented 2 years ago

:sunny: Test successful - checks-github Approved by: jdm Pushing 59213db4fe2458eefc79ea8b39f17c9b5e046c1e to master...