Closed (fixed)
Project:
@font-your-face
Version:
7.x-2.x-dev
Component:
Code (general)
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
23 Jan 2012 at 11:41 UTC
Updated:
7 Feb 2012 at 22:10 UTC
Currently, a font.css file is added even when the user didn't make any CSS declarations via the interface. This results in a css file with content like this:
<none> { font-family: Ubuntu; font-style: normal; font-weight: 500; }
Comments
Comment #1
sreynen commentedI'll work on fixing this.
Comment #2
sreynen commentedThat was quicker than I thought. Fix committed to dev.
Comment #3
BarisW commentedCool. I didn't test it, but doesn't this just create an empty CSS file? Or is there a check to see if there is content before the CSS file is created? Saves another server request where it's not needed ;)
Comment #4
sreynen commentedThere's already a check to prevent loading an empty file, so the file shouldn't get loaded. It is wasting a file write on a file that won't be used, but I think that's probably better to address in #1165658: Only re-write font.css when CSS changes
Comment #5
sreynen commentedOn second thought, once we change it so font.css isn't being re-written on every page load, it will be important to still write the empty file as an indication that it shouldn't be loaded.
Comment #6
BarisW commentedYep, you are right. The font.css is not loaded anymore so that works. While testing I found out that the reference to the font itself (the Google link) is not added when the CSS selector is set to --None--. Not sure if this is right, it might cause some confusion. If a font is enabled, it should be loaded, independent of how it is called in the theme right?