#21694 closed defect (bug) (fixed)
Twenty Twelve - Customize: Enable Open Sans Typeface
Reported by: | viniciusmassuchetto | Owned by: | lancewillett |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Bundled Theme | Keywords: | |
Focuses: | Cc: |
Description
On theme customize for Twenty Twelve, the option "Enable the Open Sans typeface" will only actually change the site font if the user doesn't have the Open Sans font on their system. So for people that have Open Sans, the option won't do anything.
If the desired behavior for this option is to switch between Helvetica/Open Sans, it should always change the body font stack.
Attachments (5)
Change History (24)
#2
follow-ups:
↓ 3
↓ 4
@
12 years ago
I recognize that my comment conflicts my original thoughts in #19978.
#4
in reply to:
↑ 2
@
12 years ago
Replying to nacin:
I recognize that my comment conflicts my original thoughts in #19978.
I like the idea of letting people choose which font they want and keep Helvetica as a default one. I'm not completely into the previous discussions about it, apart from the ones in #19978.
It can be quite a specific opinion, but one thing I don't like is to rely on Google for fonts -- even recognising it is averagely faster. I would like to be able to disable this option in my site.
#5
follow-up:
↓ 6
@
12 years ago
Setting aside the discussion about the option's existence, I think a body class to narrow the font stack is an elegant approach—keeps it all clean on style.css.
#6
in reply to:
↑ 5
@
12 years ago
Replying to matveb:
Setting aside the discussion about the option's existence, I think a body class to narrow the font stack is an elegant approach—keeps it all clean on style.css.
me too. ;)
#7
@
12 years ago
After discussion in IRC with Nacin today, we're going to:
- Remove all theme options code and support
- Make Open Sans the default font, first in the stack and always loaded
- Move customizer pieces from Theme Options out of class structure and into functions.php
I don't think make the font load based on body class is the ideal. To disable it users can use a few lines of code in their child theme, and later we can consider adding a filter so child themes can prevent the Google CSS font from loading without unhooking the entire twentytwelve_scripts_styles
action.
#9
@
12 years ago
A more elegant solution, incorporating the default font with a body_class
value, from Nacin tonight in IRC.
add a body class like body.open-sans in twentytwelve_body_class() only if wp_script_is( 'enqueue' ) for twentytwelve-fonts.
then just dequeueing the font makes the whole thing vanish.
https://gist.github.com/3494376
To dequeue in a child theme:
add_action( 'wp_enqueue_scripts', function() { wp_dequeue_style( 'twentytwelve-fonts' ); }, 11 );
See full IRC chat log.
#10
@
12 years ago
21694.diff implements the
body_class
idea -- except in testing it doesn't work.wp_script_is
appears to only verify scripts, not styles.
#12
follow-up:
↓ 13
@
12 years ago
I really like this approach. Also showcases the wp_script_is()
function, very few will know about.
In the dequeue example I'd prefer a pre-PHP 5.3 syntax for new developers, though. What do you think?
#13
in reply to:
↑ 12
;
follow-up:
↓ 14
@
12 years ago
Replying to obenland:
I really like this approach. Also showcases the
wp_script_is()
function, very few will know about.
In the dequeue example I'd prefer a pre-PHP 5.3 syntax for new developers, though. What do you think?
The one-liner was just me in IRC. It should definitely be changed.
I would like to specify a second argument to wp_style_is(), 'enqueued'. By default it is 'queue' (same) but it reads much better as a proper sentence. I am going to update the function to take a better argument in another ticket.
#14
in reply to:
↑ 13
@
12 years ago
Replying to nacin:
In the dequeue example I'd prefer a pre-PHP 5.3 syntax for new developers, though. What do you think?
The one-liner was just me in IRC. It should definitely be changed.
Suggestions welcome.
I would like to specify a second argument to wp_style_is(), 'enqueued'. By default it is 'queue' (same) but it reads much better as a proper sentence.
OK, I removed the second argument since it's the default argument. I like "enqueued" and reading as a real phrase, nice.
#15
@
12 years ago
Noting so we don't forget later, we'd like to use wp_is_style()
but patch core to change the argument value to 'enqueue' instead of 'queue' and use the default value in Twenty Twelve so it reads like a sentence:
— "WP, is style enqueued?"
— "Why yes, Konstantin — glad you asked."
:)
#16
@
12 years ago
- Owner set to lancewillett
- Resolution set to fixed
- Status changed from new to closed
In [21668]:
#17
@
12 years ago
- Cc pavelevap@… added
- Resolution fixed deleted
- Status changed from closed to reopened
Open Sans probably does not have support for Czech characters, so after activating Twenty Eleven (latest trunk), all characters like ž, š, č, etc. are not visible on website. There should be any settings for translators to disable this font by default?
I agree.
I'm close to proposing we rip the option out and just always go with Open Sans. That then saves us from a lot of extra code in 2012.