Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
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
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Font used to display code

Font used to display code

Scheduled Pinned Locked Moved Site Bugs / Suggestions
mobilecomquestion
6 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • dangD Offline
    dangD Offline
    dang
    wrote on last edited by
    #1

    Hi all Is there a way to change the font CP uses to display code snippets in articles? My new tablet is currently showing code in Courier New and I always code in a non serif font. Regards

    .dan.g. AbstractSpoon Software email: abstractspoon(dot)todolist(at)gmail(dot)com

    .dan.g.

    OriginalGriffO 1 Reply Last reply
    0
    • dangD dang

      Hi all Is there a way to change the font CP uses to display code snippets in articles? My new tablet is currently showing code in Courier New and I always code in a non serif font. Regards

      .dan.g. AbstractSpoon Software email: abstractspoon(dot)todolist(at)gmail(dot)com

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Do you have Consolas installed? The CSS for the code shows:

      font-family: Consolas, "Courier New", Courier, mono

      So Courier New is a "fallback" font, if Consolas isn't installed. (You can see this by using Chrome Inspect, then looking at the Computed tab for the element.)

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      dangD 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Do you have Consolas installed? The CSS for the code shows:

        font-family: Consolas, "Courier New", Courier, mono

        So Courier New is a "fallback" font, if Consolas isn't installed. (You can see this by using Chrome Inspect, then looking at the Computed tab for the element.)

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        dangD Offline
        dangD Offline
        dang
        wrote on last edited by
        #3

        Many thx OG, I'll pursue that idea. [Update] Bummer. Consolas is a MS font and appears not to be available on Android. Would it be feasible to have a fallback for Consolas in the same way there is a fallback for Courier New?

        .dan.g. AbstractSpoon Software email: abstractspoon(dot)todolist(at)gmail(dot)com

        .dan.g.

        P C 2 Replies Last reply
        0
        • dangD dang

          Many thx OG, I'll pursue that idea. [Update] Bummer. Consolas is a MS font and appears not to be available on Android. Would it be feasible to have a fallback for Consolas in the same way there is a fallback for Courier New?

          .dan.g. AbstractSpoon Software email: abstractspoon(dot)todolist(at)gmail(dot)com

          P Offline
          P Offline
          Peter_in_2780
          wrote on last edited by
          #4

          Might be a dumb idea, but can you download a font you like and rename it so your browser thinks it's consolas?

          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

          1 Reply Last reply
          0
          • dangD dang

            Many thx OG, I'll pursue that idea. [Update] Bummer. Consolas is a MS font and appears not to be available on Android. Would it be feasible to have a fallback for Consolas in the same way there is a fallback for Courier New?

            .dan.g. AbstractSpoon Software email: abstractspoon(dot)todolist(at)gmail(dot)com

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #5

            Yeah, totally. I'll just replace courier with monospace which will be Droid Sans Mono on Android

            cheers Chris Maunder

            dangD 1 Reply Last reply
            0
            • C Chris Maunder

              Yeah, totally. I'll just replace courier with monospace which will be Droid Sans Mono on Android

              cheers Chris Maunder

              dangD Offline
              dangD Offline
              dang
              wrote on last edited by
              #6

              Thx Chris, that would totally rock.

              .dan.g. AbstractSpoon Software email: abstractspoon(dot)todolist(at)gmail(dot)com

              .dan.g.

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


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups