ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

header fonts not showing properly

Open cscrum opened this issue 12 years ago • 37 comments

Here is a simple example of a grid that I am trying to enable filtering on. I'm getting strange fonts and the filter cells are not showing. Any idea of what I could be doing wrong?

cscrum avatar Oct 10 '14 15:10 cscrum

Is there supposed to be a plunker attached (the wording sounds like there is).

Usually the fonts being Chinese type characters is due to not including the font files properly, either not including them at all, or your build process not moving them to the right place.

PaulL1 avatar Oct 10 '14 18:10 PaulL1

What font files are required? I didn't see any in the example code other than the stuff required for printing pdfs.

cscrum avatar Oct 11 '14 02:10 cscrum

I am having the same issue. The icons on the menu bar either show up with strange shapes or don't show up at all, thus impacted other functionalities (i.e. date picker). Even the plunkr link within tutorial page doesn't show up right. I have also tried multiple browsers(ie, safari, firefox and chrome). none of them works right.

coffeetime96 avatar Oct 11 '14 06:10 coffeetime96

  1. The plunkers never show fonts right, they are getting blocked by cross domain policies. But they work fine on the tutorials I believe, and that's the key.
  2. If the fonts aren't working in your local application, you most likely haven't properly installed the fonts. These are in dist/release, or if you installed via bower then they're in the angular-ui-grid directory. The most likely problem is your build process not putting the fonts in the correct directory.

PaulL1 avatar Oct 11 '14 07:10 PaulL1

Thank you. I put all 6 files in the same directory this time and they worked, not for all browsers, not for all icons, for example, no dropdown icon for date-picker in both ie and firefox. But this gives me a good place to look into.

coffeetime96 avatar Oct 11 '14 08:10 coffeetime96

The date picker isn't part of ui-grid. That font would be coming from something else. On Oct 11, 2014 3:57 AM, "coffeetime96" [email protected] wrote:

Thank you. I put all 6 files in the same directory this time and they worked, not for all browsers, not for all icons, for example, no dropdown icon for date-picker in both ie and firefox. But this gives me a good place to look into.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ng-grid/issues/1786#issuecomment-58743104.

c0bra avatar Oct 11 '14 13:10 c0bra

So I found the ttf, svg, and woff files I was missing. Interestingly, even though I'm using unstable, it still complained about not finding the regular ui-grid.svg, ttf, and woff files. After loading those it works, sometimes. Sometimes I'll get no icons, sometimes I get the correct icons. FF still gives me kanji as does IE11.

cscrum avatar Oct 11 '14 14:10 cscrum

Thanks. I did notice that date picker only works on chrome, even for the demo code from ui grid tutorial site. Is it possible to have all icons related to ui-grid within one package? so it will be the same experience cross browsers.

coffeetime96 avatar Oct 11 '14 15:10 coffeetime96

I think the datepicker is an external control that not everyone would use. I don't think we'd want to include the fonts for that external control within the ui-grid font file, that would create a release dependency that doesn't make a lot of sense.

Although the fonts are a little finicky, I think that's more a consequence of fonts always being finicky. My experience was that if you're using a build process that deals with fonts properly then this works. Does anyone have an example where their build process is correctly dealing with fonts but they still get cross-browser issues?

PaulL1 avatar Oct 11 '14 18:10 PaulL1

I have added a tutorial on fonts, not because it should need a tutorial, but because it's clearly something people have issues with, given how many questions we get on it. It is http://ui-grid.info/docs/#/tutorial/116_fonts_and_installation.

PaulL1 avatar Oct 23 '14 00:10 PaulL1

Closing, as no new examples provided for over 2 weeks.

PaulL1 avatar Nov 07 '14 07:11 PaulL1

I read the couple of threads on here, and the tutorial section on fonts - still having issues. the GET requests to my fonts appear to work normally coming back with 200 OK, but I'm still seeing Korean on my ui-grids. (That's Korean, by the way, it's not Chinese or "Chinese-like", hah.)

anyong avatar Jan 11 '15 12:01 anyong

Hmm. Usually it is something misconfigured in your build scripts or some form of caching issue. But if it's loading the fonts properly, then that's a bit surprising. You don't have some part of your application expecting them in one location (and therefore loading them) and another part of your application expecting them somewhere else? I'm assuming the fonts are still working fine for you on the tutorials?

PaulL1 avatar Jan 11 '15 18:01 PaulL1

Getting this same issue with the Korean characters showing in the header.

henry74 avatar Feb 18 '15 19:02 henry74

I feel its important to note that font-awesome and bootstrap both target their fonts in a fonts directory, and I believe many of us adhere to this standard. At the time of this comment, ui-grid places their fonts in the main 'dist' directory, so technically my fonts were installed in the wrong location.

As I have no intention of changing my fonts location, an easy fix was simply to override the @font-face class for ui-grid's fonts (in this case to the fonts directory)...

@font-face {
  font-family: 'ui-grid';
  src: url('../fonts/ui-grid.eot');
  src: url('../fonts/ui-grid.eot#iefix') format('embedded-opentype'), url('../fonts/ui-grid.woff') format('woff'), url('../fonts/ui-grid.ttf?') format('truetype'), url('../fonts/ui-grid.svg?#ui-grid') format('svg');
  font-weight: normal;
  font-style: normal;
}

naijenn avatar Feb 24 '15 16:02 naijenn

@naijenn I agree with you - ui-grid should follow the unstated standard :-) The problem with your fix is it breaks the fonts in development while making it work production when your grunt/gulp scripts move it into the font directory.

+1 to having ui-grid use a font directory so the font-face change works in both production and development

henry74 avatar Feb 24 '15 20:02 henry74

Also getting 200s with loading the fonts but only showing Korean on the page. This is on both IE11 and Chrome. I've tried the fonts in both the same directory as the css and in the fonts folder and just about every other thing imaginable.

Chrome doesn't complain in the console. IE throws 3 errors: "@font-face encountered unknown error. File: ui-grid.xxx" where xxx is eot, woff, and ttf. No mention of the svg file.

lancelotdaemion avatar Mar 25 '15 14:03 lancelotdaemion

Check the 116 tutorial. It's almost certainly the installation path that you've put the fonts in.

PaulL1 avatar Mar 25 '15 19:03 PaulL1

You keep saying that while everyone is telling you otherwise, brother.

-----Original Message----- From: "Paul" [email protected] Sent: ‎3/‎25/‎2015 2:10 PM To: "angular-ui/ng-grid" [email protected] Cc: "Lancelot Dunnehoo" [email protected] Subject: Re: [ng-grid] header fonts not showing properly (#1786)

Check the 116 tutorial. It's almost certainly the installation path that you've put the fonts in. — Reply to this email directly or view it on GitHub.

lancelotdaemion avatar Mar 26 '15 05:03 lancelotdaemion

More accurately, everyone on this thread (presumably all those people who are having font issues) are saying they have issues. Everyone else who is using ui-grid is presumably not having font issues, including the tutorial pages.

It's not really possible to remotely debug someone's build scripts with a defect in the nature of "my fonts all look korean". There would need to be more information or a plunker or something that we can look at. I haven't yet seen an example where we've had access to good debug information that didn't turn out to be a build script problem, a browser security problem, or simply the files not in the right location.

PaulL1 avatar Mar 26 '15 05:03 PaulL1