Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/troika-three-text/src/TextBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,13 @@ function initContextLossHandling(atlas) {
* possible glyphs, e.g. `["t", "h", "th"]` to get the "t" and "h" glyphs plus the "th" ligature.
* @param {number} options.sdfGlyphSize - The size at which to prerender the SDF textures for the
* specified `characters`.
* @param {string} options.lang - The language code of this text; can be used for explicitly selecting
* certain CJK fonts.
* @param {function} callback - A function that will be called when the preloading is complete.
*/
function preloadFont({font, characters, sdfGlyphSize}, callback) {
function preloadFont({font, characters, sdfGlyphSize, lang}, callback) {
let text = Array.isArray(characters) ? characters.join('\n') : '' + characters
getTextRenderInfo({ font, sdfGlyphSize, text }, callback)
getTextRenderInfo({ font, sdfGlyphSize, text, lang }, callback)
}


Expand Down