NathanWalker / nativescript-ngx-fonticon

Use custom font icon collections seamlessly with NativeScript + Angular.
MIT License
76 stars 39 forks source link

Do not load on Android #13

Open Yamilquery opened 7 years ago

Yamilquery commented 7 years ago

I've tried get running this on Android, but only works right on IOS.

I get this:

JS: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
JS: Collections to load: fa
JS: ----------
JS: Loading collection 'fa' from file: font-awesome.css
chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
12-20 13:30:48.500  8656  8656 I cr_BrowserStartup: Initializing chromium process, singleProcess=true
12-20 13:30:48.567  8656  8656 I cr_DRP  : No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
chromium: [ERROR:gles2_cmd_decoder.cc(2210)] [GroupMarkerNotSet(crbug.com/242999)!:54304098]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Create: <- error from previous GL command
JS: fa-glass: \uf000
JS: fa-music: \uf001
JS: fa-search: \uf002

That looks like on Android:

captura de pantalla 2016-12-20 a la s 14 07 49 captura de pantalla 2016-12-20 a la s 14 07 57

In the module:

TNSFontIconModule.forRoot({
        'fa': 'font-awesome.css'
    })

This is my button html: <Button [text]="('fa-facebook' | fonticon) + ' Iniciar con Facebook'" class="initial-button-label fa" (tap)="showFBLogin()"></Button>

In my component: import { TNSFontIconService } from 'nativescript-ng2-fonticon';

And:

constructor(private fonticon: TNSFontIconService) {
 }
haroldSanchezb commented 7 years ago

I have the same problem, only different is the message log, but I dont see the icon

haroldSanchezb commented 7 years ago

Hey, change the font folder to fonts, should be work

Ericky14 commented 7 years ago

Try increasing the size of the font.

jorfranb commented 6 years ago

The problem is that you haven´t load in the correct way the font in your NativeScript application, the .ttf file that you save on the /fonts folder must to be declared on your css file on two ways to be recognized by android and ios itself, i´ll show you how is my font declared on my .css

.ptSans{
    font-family:PT_Sans-Web-Regular, PT Sans;
`}`

The one of the names responds at the .ttf file name, the second one responds at the font name itselfs, you can check this last name by view the content of the font file, at windows, by opening the font with Windows Explorer...

Hope this help