You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
The way React VR renders text is through a technique known as Signed Distance Function fonts. It allows us to smoothly render text at any size, without pixelation. One downside is that the technique requires us to pre-render font glyphs before shipping them. The default glyphs set contains Roman and Cyrillic characters, but nothing beyond that.
From Oculus's work with Samsung, we do do have SDF fonts for Korean glyphs. I'll add documentation for how to use custom font sets, and see if we can include those fonts in the next release of the ovrui npm package.
Reacted by Harry Moreno, Nik Graf and Gergo Bogdan
Maybe it's considerable to exclude the font from the package and provide it as external dependency. So you could use individual or reduced charsets to improve the app size.
Fallback font sets have been added to react vr and the docs have been updated again.
Fallback fonts allow to support the full font set and the cost of extra download. There is no reason why mono emoji characters can't be supported with this.
Hey, I kind of understand how this came about, but couldn't we generate the SDFs dynamically when the user needs them based on the fonts they have installed?
In my mind it's pretty regressive to think that users only communicate in one character set or another per-user or per-app. In my facebook feed I have english, arabic, icelandic, turkish, chinese, and japanese characters regularly. Not to mention that real communication in 2017 has tons of emoji.
@darknoon It would be great if we could achieve that, but there are a few technical limitations standing in our way:
Access to the font itself — I've worked on a number of pdf-in-browser and similar document renderers, as well as JS tools to build and manipulate TTF and OTF fonts. The browser lets us render content with fonts, and in some cases get metadata about characters in fonts, but we never have access to the raw font data itself, which would be needed for an optimal SDF generator. Without that, we're never going to be fast.
Generating the full set of fonts is prohibitively slow in the current state of things — even if we had full access to the underlying parametric data of the glyphs, we'd still need to spend time generating the proper metadata, which would likely hurt your application's time-to-interaction.
Not all fonts want to be SDF-rendered. The font face we provide is designed to scale nicely with SDF techniques. If you did that with arbitrary fonts found on your computer, you would find that certain angles and curves don't preserve when rendered through the SDF technique.
As Mike mentions above, we're now capable of chaining fallback fonts together, so you can support EFIGS + JK out of the box, as well as any other font faces you wish to generate on your own. We think that's a good step in i18n support while we actively explore other generation techniques. I do look forward to being able to support emoji myself!
Could the fonts be published as part of the ovrui package or inside a new one? I don't like the ideea of copy-pasting them into my project. It would be cool if I could load them directly from node_modules.
@RadValentin we used to do that, but intentionally removed them.
It's convenient to write that during development, but your final production build won't have a node_modules folder! This created repeated confusion for developers who were linking into the npm package to fetch their font files, and not able to find the file when deploying to servers, so we removed them.
The link provided to use custom fonts is not working anymore (legacy react vr doc). I can't find anything in the react 360 documentation. Is there still a way to use custom fonts in react 360 ?
Activity
amberroy commentedon Feb 10, 2017
We haven't done much testing with UTF-8 thanks for bringing it to our attention, will take a look.
andrewimm commentedon Feb 13, 2017
The way React VR renders text is through a technique known as Signed Distance Function fonts. It allows us to smoothly render text at any size, without pixelation. One downside is that the technique requires us to pre-render font glyphs before shipping them. The default glyphs set contains Roman and Cyrillic characters, but nothing beyond that.
From Oculus's work with Samsung, we do do have SDF fonts for Korean glyphs. I'll add documentation for how to use custom font sets, and see if we can include those fonts in the next release of the
ovruinpm package.andrewimm commentedon Mar 24, 2017
FYI documentation on how fonts are handled has been updated here: https://facebook.github.io/react-vr/docs/fonts.html
LiuC520 commentedon Apr 1, 2017
The same to me ,I can't use chinese in Text node.
I've alreay translate your website into chinese using react ,the website is www.vr-react.com
Ninerian commentedon Apr 1, 2017
andrewimm commentedon Apr 1, 2017
Again, here's a link to the documentation describing how to use the included Japanese and Korean font sets, and how to make your own custom fonts: https://facebook.github.io/react-vr/docs/fonts.html
mikearmstrong001 commentedon Apr 22, 2017
Fallback font sets have been added to react vr and the docs have been updated again.
Fallback fonts allow to support the full font set and the cost of extra download. There is no reason why mono emoji characters can't be supported with this.
the fonts can't be found in the OVRUI repo
https://github.com/OculusVR/ovrui/tree/master/fonts
darknoon commentedon Apr 24, 2017
Hey, I kind of understand how this came about, but couldn't we generate the SDFs dynamically when the user needs them based on the fonts they have installed?
In my mind it's pretty regressive to think that users only communicate in one character set or another per-user or per-app. In my facebook feed I have english, arabic, icelandic, turkish, chinese, and japanese characters regularly. Not to mention that real communication in 2017 has tons of emoji.
andrewimm commentedon Apr 24, 2017
@darknoon It would be great if we could achieve that, but there are a few technical limitations standing in our way:
Access to the font itself — I've worked on a number of pdf-in-browser and similar document renderers, as well as JS tools to build and manipulate TTF and OTF fonts. The browser lets us render content with fonts, and in some cases get metadata about characters in fonts, but we never have access to the raw font data itself, which would be needed for an optimal SDF generator. Without that, we're never going to be fast.
Generating the full set of fonts is prohibitively slow in the current state of things — even if we had full access to the underlying parametric data of the glyphs, we'd still need to spend time generating the proper metadata, which would likely hurt your application's time-to-interaction.
Not all fonts want to be SDF-rendered. The font face we provide is designed to scale nicely with SDF techniques. If you did that with arbitrary fonts found on your computer, you would find that certain angles and curves don't preserve when rendered through the SDF technique.
As Mike mentions above, we're now capable of chaining fallback fonts together, so you can support EFIGS + JK out of the box, as well as any other font faces you wish to generate on your own. We think that's a good step in i18n support while we actively explore other generation techniques. I do look forward to being able to support emoji myself!
liyuechun commentedon May 8, 2017
http://www.react-vr.org
http://bbs.react-vr.org
RadValentin commentedon Jul 1, 2017
Could the fonts be published as part of the
ovruipackage or inside a new one? I don't like the ideea of copy-pasting them into my project. It would be cool if I could load them directly fromnode_modules.andrewimm commentedon Jul 3, 2017
@RadValentin we used to do that, but intentionally removed them.
It's convenient to write that during development, but your final production build won't have a node_modules folder! This created repeated confusion for developers who were linking into the npm package to fetch their font files, and not able to find the file when deploying to servers, so we removed them.
genievn commentedon Jul 10, 2018
Hi,
I've just realized Vietnamese is not supported too, any solution yet?
andrewimm commentedon Jul 10, 2018
@genievn the text rendering pipeline is currently being overhauled to allow use of all system fonts
jcyh0120 commentedon Mar 2, 2019
any solutions yet? I would like to use Chinese text words.
oussj commentedon Nov 2, 2020
Hello @andrewimm
The link provided to use custom fonts is not working anymore (legacy react vr doc). I can't find anything in the react 360 documentation. Is there still a way to use custom fonts in react 360 ?