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. General Programming
  3. C#
  4. Display a grid of all character of a font

Display a grid of all character of a font

Scheduled Pinned Locked Moved C#
csharpcsshelptutorialquestion
9 Posts 5 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.
  • B Offline
    B Offline
    baranils
    wrote on last edited by
    #1

    Hello I'm looking for some Csharp component to display all character of a selected font, allowing selection Charmap.exe is a good example It can be very usefull in order to select special character as Webdings, Windings, Symbols or cyrillic . etc Any idea ? Thanks for your help

    P L 2 Replies Last reply
    0
    • B baranils

      Hello I'm looking for some Csharp component to display all character of a selected font, allowing selection Charmap.exe is a good example It can be very usefull in order to select special character as Webdings, Windings, Symbols or cyrillic . etc Any idea ? Thanks for your help

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      I would try a TextBox (set to multi-line) or a RichTextBox; insert the appropriate characters, and then set the font as required. Or you could use a whole bunch of Labels X| .

      1 Reply Last reply
      0
      • B baranils

        Hello I'm looking for some Csharp component to display all character of a selected font, allowing selection Charmap.exe is a good example It can be very usefull in order to select special character as Webdings, Windings, Symbols or cyrillic . etc Any idea ? Thanks for your help

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Someone did a similar thing here (can't post the code, I'm afraid) by : For each char from 32 to 255 create a label with a border, width and height as appropriate, and the font set to the desired font, Text of the char.ToString(); The labels can then be positioned however you want for a pleasing display. On the click event of the label, it displays the same character in a label using the same font with an increased size, and on double-click it raises a 'CharacterSelected' event which pass back the font and character selected. Should be enough to get you started?

        ___________________________________________ .\\axxx (That's an 'M')

        L 1 Reply Last reply
        0
        • L Lost User

          Someone did a similar thing here (can't post the code, I'm afraid) by : For each char from 32 to 255 create a label with a border, width and height as appropriate, and the font set to the desired font, Text of the char.ToString(); The labels can then be positioned however you want for a pleasing display. On the click event of the label, it displays the same character in a label using the same font with an increased size, and on double-click it raises a 'CharacterSelected' event which pass back the font and character selected. Should be enough to get you started?

          ___________________________________________ .\\axxx (That's an 'M')

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Yeah, but how can one find out ALL the characters present in a specific font, without looping all Unicode char codes and measuring string width looking for non-zero? :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


          L 1 Reply Last reply
          0
          • L Luc Pattyn

            Yeah, but how can one find out ALL the characters present in a specific font, without looping all Unicode char codes and measuring string width looking for non-zero? :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            not sure you need to - just display 'em - you'll get an empty box if they're not defined in that font.

            ___________________________________________ .\\axxx (That's an 'M')

            L 1 Reply Last reply
            0
            • L Lost User

              not sure you need to - just display 'em - you'll get an empty box if they're not defined in that font.

              ___________________________________________ .\\axxx (That's an 'M')

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              I am not going to create a grid with ten thousands of cells, I want to know what characters are present without painting anything. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


              L 1 Reply Last reply
              0
              • L Luc Pattyn

                I am not going to create a grid with ten thousands of cells, I want to know what characters are present without painting anything. :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Sorry - misread/misunderstood. Yep - you don't want to have a dialog popping up that you have to scroll forever to find used characters... just stick with 33 through 255 if you ask me!

                ___________________________________________ .\\axxx (That's an 'M')

                B 1 Reply Last reply
                0
                • L Lost User

                  Sorry - misread/misunderstood. Yep - you don't want to have a dialog popping up that you have to scroll forever to find used characters... just stick with 33 through 255 if you ask me!

                  ___________________________________________ .\\axxx (That's an 'M')

                  B Offline
                  B Offline
                  baranils
                  wrote on last edited by
                  #8

                  Hello thanks for all reply I was lookin for an "out of the box" tool The solution to create 256 labels seems a liitle bit heavy Finaly maybe using a datagridview can be the right solution ??

                  M 1 Reply Last reply
                  0
                  • B baranils

                    Hello thanks for all reply I was lookin for an "out of the box" tool The solution to create 256 labels seems a liitle bit heavy Finaly maybe using a datagridview can be the right solution ??

                    M Offline
                    M Offline
                    Member 4001120
                    wrote on last edited by
                    #9

                    Well, behind the scenes all a datagridview is going to do is to create the labels for you, so I'm not sure why you think it's a bit heavy - it also gives you complete control over your presentation. I reckon you could knock up the code in 1/2 day easy - then publish it as an article on CP for the glory of it

                    .\\axxx

                    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