Rollup: How to add Fonts as a part of Library Build - rollup

I'm creating a Javascript UI Library where I want to use Roboto Font as a part of Library. I have used "rollup-plugin-url" but it is not working.

Related

Create a .aar file from my react-native project and use it in other project?

is it possible? does .aar contain the javascript code what i have written for screens and components? will i be able to impost specific component from .aar in my new project?
Tried couple of things like this text but not able to generate .aar

Is there a way to use custom icons in React Native without any third party library?

I know we can't use SVG directly in RN, but we can convert it to .ttf. My question is how can we use those TTF files without installing react-native-vector-icons and similar libraries? All tutorials I could find on Google involve installing such libraries, but I'm not allowed to use them in my project. I'm not allowed to implement any solution that requires changes in the android or iOS folders.
What do I know so far?
Well, I can go to fontello.com and convert any SVG icon to .ttf. It'll generate a folder containing the font file and also a config.json file.
What I don't know?
I don't know how to use the files generated by Fontello to display the icon without the help of any library.
Answering my own question, you can put the TTF files inside android/app/src/assets/fonts and use them directly as a font family name. The problem is that I'm creating an NPM package, so it's not a suitable solution. So I discovered that react-native-svg doesnt'need any special configuration, and you can use the XML code directly by importing SvgXml from the library.

How can I use an external library in a react native module

I am creating a react native library using this library, but my issue is how to add an external library (e.g library.framework) into it.
When I drag the library to a normal application project I see the library added to Frameworks, Libraries, and Embedded content under the "General tab" and I am able to use it perfectly.
Image - using the library in a normal application project
But when I create an react native module and try to use the library I created it the created-react-library > ios. The is no general tab, hence the library cannot be accessed.
Image - using the library in a react native create module > ios project
what is the proper way of using an external library in a react-native-create-library module?
You need to select a target under your project, to see the general tab.

include dojo toolkit in appcelerator titanium

I want to use dojoToolkit in my project. But when I include it with Ti.include('dojo/dojo/dojo.js') I have got a error message "defineAlreadyDefined". Titanium has method called define in global namespace and there is method with similar name in dojo. Also there are some other methods with similar names (for example, required). How can I use it?
P.S. I build my project for web
Dojo as is will not work in Titanium. Dojo is a browser toolkit, not a mobile toolkit, it accesses things that are only for the web.
But, this guy ported it over to work with titanium, try it instead.

Is it possible to include fonts in an app bundle and make them available in a UIWebView

I'm working on some HTML5 content to be included as part of an iPad app in a Web View and it requires some custom fonts which I was attepting to implement via CSS and #font-face
As I understand it, Mobile Safari only supports SVG fonts, but my testing has shown Mobile Safari to really struggle with SVG and the performance hit is a serious issue.
So... is it possible to put fonts in the App Bundle and somehow make them available to the webview?
Yes it is. Include the fonts in the App Bundle and in the app-info.plist use
"Fonts provided by application"
and provide the file name for each font.
Looks something like this...