choffmeister / roboto-fontface-bower

Bower package for the Roboto font-face
Apache License 2.0
153 stars 57 forks source link

Case-sensitivity issue - file not found #41

Closed mkowalski closed 7 years ago

mkowalski commented 7 years ago

Hi,

In OpenStack Horizon project we are using roboto-fontface. Apparently there is a problem with resolving $variant regarding "Roboto" vs. "roboto".

On the filesystem fonts are available under lib/roboto_fontface/fonts/**roboto**/**Roboto**-Regular.woff2 whereas in https://github.com/choffmeister/roboto-fontface-bower/blob/master/css/mixins.scss#L5 you use $variant twice, but in both cases the first letter has a different case-sensitivity.

In the correct case you would like to have $font-full-path: '#{$roboto-font-path}/roboto/Roboto'; which means the same variable $variant cannot be used twice.

I'm not so into CSS to provide a fully working patch, but I would see something like $font-full-path: '#{$roboto-font-path}/#{to-lower-case($variant)}/#{$variant}'; as a fix to this problem. The file https://github.com/choffmeister/roboto-fontface-bower/blob/master/css/mixins.less#L5 should be patched in a similar way.

The other way around would be to place files in lib/roboto_fontface/fonts/**Roboto**/**Roboto**-Regular.woff2 or lib/roboto_fontface/fonts/**roboto**/**roboto**-Regular.woff2 to maintain the same case-sensitivity across all the path, but I personally consider patching CSS as a more appropriate way in here.

Cheers, Mateusz

choffmeister commented 7 years ago

@mkowalski Thx for the hint. Will try to fix it as soon as possible. But it might take some days.

mkowalski commented 7 years ago

Cool, thanks.

I have tried to fix at least part of it and managed with SCSS -- https://review.openstack.org/#/c/443025/1/xstatic/pkg/roboto_fontface/data/css/mixins.scss

Unfortunately my Googling for LESS didn't work out very nicely...

noseglid commented 7 years ago

This still doesn't seem correct.

in mixin.scss:

$font-full-path: '#{$roboto-font-path}/#{to-lower-case($variant)}/#{$variant}';

which will be something like ../../../fonts/roboto/Roboto and later the url will be: ../../../fonts/roboto/Roboto-Black.eot (repeat for all formats);

But according to the source it looks to be uppercase, so it should be ../../../fonts/Roboto/Roboto.

Am I missing something?

mkowalski commented 7 years ago

No, you're right. Capitalization changes from tag to tag which makes a lot of mess. I will try to review what's the correct one at this moment