Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Font encoded in Base64

Font encoded in Base64

Scheduled Pinned Locked Moved General Discussion
7 Posts 2 Posters 279 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    paulstolle
    wrote on Jan 29, 2021, 12:50 AM last edited by
    #1

    Hi there,

    I just bought a font which is already encoded in Base64 to add on any website.

    The foundry provided me a font.css like this:

    @font-face {
      font-family:'FONT_NAME';
      src: url(data:application/font-ttf;charset=utf-8;base64,BASE64_STRING) format('truetype');    
      font-weight: normal;
      font-style: normal;
    }
    

    How should I handle this the best way?

    Thanks a lot!
    Paul

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Richard
      Global Moderator
      wrote on Jan 29, 2021, 6:34 AM last edited by
      #2

      Dear Paul @paulstolle

      Hoping that some of the content in this thread can help you:

      http://laythemeforum.com:4567/topic/917/activate-styllistic-sets/2

      @font-face is normally place within the style.css document of a website and you give it a font-family name ('font-name') now that its loaded, it can be called upon throughout the website and used for text by addressing the name:

      https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp

      Best wishes
      Richard

      1 Reply Last reply
      0
      • P Offline
        P Offline
        paulstolle
        wrote on Jan 29, 2021, 2:16 PM last edited by paulstolle Jan 29, 2021, 9:16 AM
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • P Offline
          P Offline
          paulstolle
          wrote on Jan 29, 2021, 10:56 PM last edited by
          #4

          Thanks a lot @Richard-K!

          So I placed my font right into Lay Options -> Custom CSS & HTML -> Custom <head> content like this:

          <style> 
          
          @font-face {
              font-family: 'Wasa-r';
              src:url(data:font/truetype;charset=utf-8;base64,T1RUTwA…
              format('truetype');
              font-weight: normal;
              font-style: normal;
          }
          
          </style>
          

          Under Custom CSS I placed this line of code:

          div, span, p, a, h1, h2, h3, h4, h5, h6, h7 { font-family: Wasa-r !important;} 
          

          (Without !important it's not changing all properties on my site.)

          Right now it's working but I've found no way to change the font-style in Text Formats visibly (all changes there are working but without preview).

          Is this way bulletproof or did I missed a point? Should I install the font via <script> tag and CSS under Lay Options -> Webfonts to make it more resistant?

          Would be happy about further help from you!

          Thanks a lot,
          Paul

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Richard
            Global Moderator
            wrote on Feb 2, 2021, 5:04 AM last edited by
            #5

            Dear @paulstolle

            So its working in general? Thats great :)
            But you have issue with it providing a preview in text formats?

            Does it work on the Front-end ( your website? )

            best wishes
            Richard

            1 Reply Last reply
            0
            • P Offline
              P Offline
              paulstolle
              wrote on Feb 2, 2021, 10:42 PM last edited by
              #6

              Dear @Richard-K

              Yeah, it's working in general. I can also adjust things in Text Formats but there is no preview of the actual font in there.

              However, now I got the .woff2 files and everything is fine. But maybe this topic will help somebody else?

              Thanks a lot for your support and all the best!

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Richard
                Global Moderator
                wrote on Feb 2, 2021, 11:16 PM last edited by
                #7

                Dear @paulstolle

                Great, this will definitely help someone in the future - i have it saved as a thread to help with this topic :)

                Thank you Paul and hope you have a lovely week

                Sincerely
                Richard

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes

                2/7

                Jan 29, 2021, 6:34 AM

                5 unread

                I also code custom websites or custom Lay features.
                💿 Email me here: 💿
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                This often solves issues you might run into

                When you post:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                M
                MWPA
                5 minutes ago
                O
                okitswinter
                25 minutes ago
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                2 out of 7
                • First post
                  2/7
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search