Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using angular-ui bootstrap components with fonts #22

Open
deviantony opened this issue May 15, 2015 · 4 comments
Open

Using angular-ui bootstrap components with fonts #22

deviantony opened this issue May 15, 2015 · 4 comments

Comments

@deviantony
Copy link
Contributor

When trying to use the datepicker component from the angular-ui bootstrap library, I got the following errors in Firefox:

NetworkError: 404 Not Found - http://localhost:9000/fonts/glyphicons-halflings-regular.woff

How can I link the fonts to my build? I've tried to add the vendor/bootstrap/dist/fonts* folder to the assets folder in the Gruntfile but with no success.

Is there any particular way of using these components? Can I easily replace these fonts by the one provided by Font Awesome?

@thardy
Copy link
Owner

thardy commented May 21, 2015

I just got done fixing several other issues and don't have time to get to this tonight, but hopefully I'll have time to look at this over the weekend.

@deviantony
Copy link
Contributor Author

The weird thing is that this error seems to happen on Firefox only, works fine in Chrome.

@thardy
Copy link
Owner

thardy commented Jun 12, 2015

I fixed a similar issue this morning with vendorcss not being copied. I'm thinking vendor assets are not copied either. If you're adding that file to the vendor_files:assets variable in the gruntfile, I don't think there's a task setup to actually do anything with it.

Look at the one I just closed and see if that's the same scenario, just with assets instead of css - #23.

I'm going out of town this weekend, but I will look into it when I get a chance. If you want to tackle it sooner, look at my last commit for the pattern that may lead to your fix - c345109. We just need to do the same thing for assets that I did for css.

@jluna79
Copy link

jluna79 commented Jun 22, 2015

I've been taking a look to this. It seems that out of the box the copy:build_vendor_assets does work, you just have to add the files you want to be copied under vendor_files.assets.

However, the problem is that the actual 404 is being thrown because vendor assets are copied to the build/assets folder but the app looks for them in the build/fonts directory. Here is one of the errors I'm getting, started by a bootstrap's css:

Request URL:http://localhost:9000/fonts/glyphicons-halflings-regular.ttf
Request Method:GET
Status Code:404 Not Found

So, there are 2 solutions that I can think of:

  1. Create a new set name vendor_files.fonts and a new set of copy tasks that would copy the specified vendor fonts into build/fonts. This keeps automation and seems doable but something doesn't feel right for me, it is over-specific about having to create a lot of tasks for a very specifc thing (usually vendors do not need many fonts).
  2. Since we know that if you are using bootstrap you will need the glyphicons in the fonts folder why not create a task that will always copy all glyphs from the vendors/bootstrap folder into build/fonts?

@thardy which one (if any) would be the appropriate one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants