Hi,

Thanks so much for contributing this amazing module. Is there a way that I could apply this method of font switching for block, page and/or view titles?

Thanks

Comments

vph’s picture

You should be able to use the filter in a block body. For titles, it can be done, but you'll have to modify your themes. And it will affect all titles.

I've just improved the module (in dev version) to allow the specification of line height, which can be useful for certain fonts and multi-line paragraphs.

pribeh’s picture

Sorry, could you provide an example? Should this be done in the template file then as an override? I'm not very good at coming up with those :)

pribeh’s picture

I could imagine applying this to say all h2 or h3 tags..

Line-height specification is really handy!

vph’s picture

>I could imagine applying this to say all h2 or h3 tags..

I'll try to implement this in the next version.

pribeh’s picture

Amazing. I see the module got updated with said feature request!

Unfortunately, I am getting the following bug - let me know if I should open up another issue for it:

warning: file_get_contents(sites/all/modules/dfont/dfont.js) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/blah/includes/common.inc on line 2412.
warning: file_get_contents(sites/all/modules/dfont/dfont.js) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/blah/includes/common.inc on line 2412.

pribeh’s picture

Ok, that error has gone away but I'm having an issue with the h2/h3 tags. I've inputted df1m in the h1 or h2 tags but the h1 or h2 tags on my pages are not adopting the font. They do acquire the df1m class in the tag, appear to change size, but no font change occurs. Will do some more testing and report back.

pribeh’s picture

Sorry, my CSS was overriding it. But by removing hierarchical CSS statements like #sidebar-right .block h2 allows dfonts javascript to override the default h2 font style.

pribeh’s picture

This is amazing. One other potential request that relates to this and may not be worth opening another issue but is it possible to have the ability to choose our own tag (via the dj admin) to associate a df class with?

vph’s picture

Hi, what theme are you using? I'd like to take a look. Thanks.

sonlinemedia’s picture

Love this module. We used it last night and I want to share a method I used to apply it to our theme. We use a rich text editor for our clients sites so they can do basic updates. However, from what I saw on your instructions we had to place the [dfont] tags around the content to make it work. So instead of doing this on the content page I opened my theme file and added the style class on the body tag in the html.

EXAMPLE: under admin -> dynamic fonts, it shows to input this for the font style you desire: Usage: [dfont=df2m] ... [/dfont]
The text after the "=" is the class title assigned. So I added this on the page.tpl.php page's body tag --> <body class="df2m">

Hope others find this useful :)

vph’s picture

Thanks. I'm glad you found it useful.

I try not to make this module more complex than it needs to be. The filter provides *local* font formatting of individual paragraphs. If you want to make *global* changes, in addition to presetting the h1, h2, h3 tags, you can also do what solinmedia did. Additionally, you can go directly to the style.css files and specify the font-family there. For example, if you want *all* .content class to be of font family GentR102 (you'll have to use the font's full name). Look for something like this in your theme's style.css:

.content {
    // other things
}

and add 3 lines like this:

.content {  
   font-family: GentR102;
   font-size: 200%;
   line-height: 105%;
   // other things
}

When I have time later this week, I'll add some features to HEAD to make this process more efficient.

pribeh’s picture

Oh, that completely simplifies everything for me! Sorry I'm a bit slow :)

I love this module! Thanks vph and sonlinemedia! You should definitely close the issue now.

vph’s picture

Status: Active » Closed (fixed)

closed