MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / registerFontsInFolder

Function registerFontsInFolder

packages/core/ui/styling/font.ios.ts:174–188  ·  view source on GitHub ↗
(fontsFolderPath)

Source from the content-addressed store, hash-verified

172}
173
174function registerFontsInFolder(fontsFolderPath) {
175 const fontsFolder = Folder.fromPath(fontsFolderPath);
176
177 fontsFolder.eachEntity((fileEntity: FileSystemEntity) => {
178 if (Folder.exists(path.join(fontsFolderPath, fileEntity.name))) {
179 return true;
180 }
181
182 if (fileEntity instanceof File && (fileEntity.extension === 'ttf' || fileEntity.extension === 'otf')) {
183 ios.registerFont(fileEntity.name);
184 }
185
186 return true;
187 });
188}
189
190function registerCustomFonts() {
191 const appDir = knownFolders.currentApp().path;

Callers 1

registerCustomFontsFunction · 0.85

Calls 4

joinMethod · 0.80
eachEntityMethod · 0.65
fromPathMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected