Skip to content

Handle incorrect fontFamily gracefully. #3918

Open

Description

@tbandrowsky

Environment

If you are using latest version:

  1. react-native -v:

react-native-cli: 2.0.1
react-native: 0.60.6

  1. react-native run-windows --info:

System:
OS: Windows 10 10.0.18362
CPU: (32) x64 AMD Ryzen Threadripper 1950X 16-Core Processor
Memory: 10.17 GB / 15.90 GB
Binaries:
Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react: 16.8.6 => 16.8.6
react-native: ^0.60.0 => 0.60.6
react-native-windows: 0.60.0-vnext.115 => 0.60.0-vnext.115
rnpm-plugin-windows: ^0.4.0 => 0.4.0
Installed UWP SDKs:
10.0.14393.0
10.0.16299.0
10.0.17134.0
10.0.17763.0
10.0.18362.0

Then, specify:

I have no idea what React-Native vNext is doing there. Just going with the defaults of installing React

Windows

I have VS2019, but RNWVN installed the earlier toolchain.

Debug

Steps to Reproduce

Pretty sure it's this. A blank fontFamily on an inline Text causes a D3D shitshow and exceptions.

<Text style={{ fontFamily:'', marginTop:6, fontSize:30, color:'white'}}>Dynamic Course POC

Expected Behavior

It should complain either that I had a bad font. But not crash.

Complain I had a bad font.

Actual Behavior

Kaboom.

Activity

  1. ghost added
    Needs: Triage 🔍
    on Jan 21, 2020
  2. aschultz commented on Jan 23, 2020

    @aschultz
    Contributor

    Looks like the winrt::Windows::UI::Xaml::Media::FontFamily constructor throws when given an empty string.

    I'll include a fix in my PR for #3830.

  3. added and removed
    Needs: Triage 🔍
    on Jan 23, 2020
  4. chrisglein commented on Jan 23, 2020

    @chrisglein
    Member

    Thanks Aaron Schultz (@aschultz) for picking this up!

  5. added
    Workstream: Component Parity
    on Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: TextWorkstream: Component Paritybug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions