Jump to content
mrhinsh

Add custom font to pagelines

Recommended Posts

mrhinsh    2
mrhinsh

Guys,

I am looking to add a custom font combination to the list of fonts. The font that I want is not listed...

-MrHinsh

p.s. I don't care if it is websafe :) thats what fallback is for...

Share this post


Link to post
Share on other sites
mrhinsh    2
mrhinsh

So I added the Customisation plugin and edited the funcations.php to add:


add_filter ( 'pagelines_foundry', 'metro_body' );

add_filter ( 'pagelines_foundry', 'metro_heading' );

add_filter ( 'pagelines_foundry', 'metro_link' );


function metro_body( $thefoundry ) {

                $myfont = array( 'metro body' => array(

                                'name' => 'metro body',

                                'family' => '"metro body", Segoe UI Light, Segoe UI, Tahoma, Arial, Verdana, sans-serif',

                                'web_safe' => true,

                                'google' => true,

                                'monospace' => false

                                )

                        );

                return array_merge( $thefoundry, $myfont );

        }


function metro_heading( $thefoundry ) {

                $myfont = array( 'metro heading' => array(

                                'name' => 'metro heading',

                                'family' => '"metro heading", Segoe UI Bold, Segoe UI, Tahoma, Arial, Verdana, sans-serif',

                                'web_safe' => true,

                                'google' => true,

                                'monospace' => false

                                )

                        );

                return array_merge( $thefoundry, $myfont );

        }


function metro_link( $thefoundry ) {

                $myfont = array( 'metro link' => array(

                                'name' => 'metro link',

                                'family' => '"metro link", Segoe UI, Segoe UI Light, Tahoma, Arial, Verdana, sans-serif',

                                'web_safe' => true,

                                'google' => true,

                                'monospace' => false

                                )

                        );

                return array_merge( $thefoundry, $myfont );

        }

But I do not get the new fonts listed. What am I doing wrong?

Share this post


Link to post
Share on other sites
mrhinsh    2
mrhinsh

OK, so watch out for the evil /* and */ that comment our your code!

Once I fixed them everything worked :)

Share this post


Link to post
Share on other sites
Rob    547
Rob

It's wonderful when our clients ask and answer their own questions.

You might have been able to use Cufon fonts for this.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • Barnaby Skinner
      By Barnaby Skinner+
      Hey all, hope I worded the topic correctly!
      I just need to know if either 1) I'm making a mistake or 2) this could be set as a new feature?
      Using the global settings typography parameters, I have a global paragraph font type (set using googlefonts) and have set the style to align:justify. When laying out <p> text inside a simple TEXT module, the <p> text adheres to both the font type and justification. Perfect.
      Now, when I set <p> text inside the PARAGRAPH TEXT field within an ELEMENT module, the <p> text adheres to the font type, but not the justification. It's rather annoying as I like to fully justify para text across the board and tend to use Element modules instead of text boxes for various reasons. It also seems silly that some PARAGRAPH TEXT fields adopt global settings, whilst other don't.
      Or I'm doing it wrong :S
      Any help or advice is much appreciated!
      Cheers
    • John Olsson
      By John Olsson+
      Hello,
      I wondering (and custumers) when does Font Awesome 4.7 comes with an update of Pagelines?
    • Queue-it
      By Queue-it+
      Hi,
      I have the primary font family set to Arial. If I add another font (Open Sans), how do I change it only on a specific page? 
      I want to have Open sans only on one of my landing pages, but by default it will fetch Arial. Is there a way to change it without a plugin?
       

    • Skip
      By Skip+
      Hello
      I'm having problems with the Font not appearing correctly on a website.
      I've adjusted the font correctly with DMS (see screen shot) and saved it repeatedly yet it does not adjust the font in the website (see screen shot).  Would you please let me know what is wrong and should be done?
      (Please note that I've cleared the cache in the browser and whatnot as far as basic things I do know about browsers and issues with DMS from the past.  Hope this helps in troubleshooting...)
      Thank you.
      Skip


    • Barnaby Skinner
      By Barnaby Skinner+
      Hey all,
      I've been trying to justify the base font in PL5 with the Framework theme, but in doing so it's thrown a curve ball; it seems the font styling used by many of the PL5 Element sections (masthead etc) is overriding the global CSS.
      I set the base font style to justified in the Typography backend panel, and it seems to only apply to the base font used in standard Text sections, not to the base font used in text boxes within Element sections, could be others too, but not checked.
      Can we override this? It seems odd to have to (somehow) apply justification many times to different containers using the same base font, right?
      Also - I tried to add the CSS font-variant: small-caps; to the H3/4/5/6 CSS field in Typography panel, and again nothing happens, this time not even in Text sections!
      Confused I am! Please help...
      Cheers
      Barney
×