No announcement yet.

Unicode - Symbols and Letters on Same Line

  • Filter
  • Time
  • Show
Clear All
new posts

  • Unicode - Symbols and Letters on Same Line

    I noticed an article online showing that Unicode provides check mark symbols/characters. Here's an example of displaying the characters in a textbox. It's very simple code - basically nothing but placing a Unicode string into the control.

    The checkbox color can match that of the text. There's no imagelist nor icons required. And, the choice of font size handles the size of the checkbox.

    With Unicode, you can put the symbols and letters on the same line since they are all the same font. Most controls won't let you put 2 different fonts on the same line of text, or even in the same control text area. That solves the problem of trying to use WIng Dings characters with text, which requires two fonts.

    The following code came out of a discussion between Pierre Bellisle and I over the last day.

    Knowing the Unicode character code is required of course. Here's a link from Pierre to help with that.

    #Include ""
    Function PBMain() As Long
       Local hDlg As Dword
       Dialog Font "Tahoma",72,1
       Dialog New Pixels, 0, "Unicode", , , 200, 150, %WS_SysMenu, 0 To hDlg
       Control Add TextBox, hDlg, 500,"Unicode " + Chr$$(&h2610,&h2611), 0, 0, 200, 150
       Control Post hDlg, 500, %EM_SETSEL, -1, -1
       Dialog Show Modal hDlg
    End Function
    I'll go back to my post on large checkboxes and post a solution using Unicode characters.
    Last edited by Gary Beene; 17 Jun 2017, 08:57 PM.

  • #2
    Edited and withdrawn - didn't see you already mentioned Windings - sorry. BTW, link not working.


    • #3
      Hi Borje!
      Link fixed. Thanks for letting me know.


      • #4

        I found this, Zipped Unicode Viewer on SourceForge, it might be a good add-on in your tool folder...
        UnicodeViewer.exe files path...



        • #5
          Hey Pierre!

          Thanks for the link. That app allows me to open to open one of the supplied files and view each of the available unicode characters, yes? I opened "unicode\allkeys.txt" to try it out.

          I've been using plain old NotePad to simply view Unicode text files.


          • #6
            With Unicode, you can put the symbols and letters on the same line since they are all the same
            This is not necessarily true, because there is no font that has all the characters supported by
            unicode. And it is certainly not true for the code you posted.

            Font fallback and font linking are two mechanisms that can be used to replace the current font
            when it does not support the character to be rendered with a font that does. This is handled
            transparently by controls and applications that properly handle international text. For example,
            web browsers, Microsoft Word, Visual Studio, RichEdit and edit controls. Because of the nature
            of the edit control, one is easily misled into thinking that it is only using one font.
            An example of a control and an application that handles the editing of international text rather
            poorly would be NotePad++ and the Scintilla control.

            Using the code in your post as an example,
            the text "Unicode" would be rendered using the default font Tahoma, and the unicode
            characters 'BALLOT BOX' and 'BALLOT BOX WITH CHECK' would be rendered using another font
            such as Segoe UI Symbol, or Meiyro, or Arial Unicode MS.
            Dominic Mitchell
            Phoenix Visual Designer


            • #7
              I like those magic keywords: Font fallback and font linking.
              That googlelize to Font Technology


              • #8
                Another very useful Unicode utility is BabelMap.

                It has font analysis and font coverage (which code point / glyph is available in which font) and much more.
                Rgds, Dave


                • #9
                  I also found my way Font Technology while trying to work out why the checks in Gary's test code were shown differently on my Windows10 and Windows7 (pro 64bit) PCs.

                  On Windows10 I see a Segoe UI Symbol glyph while on Windows7 I see a MS UI Gothic glyph.

                  I'm trying to figure out if the Registry entries at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink are what are used by Windows or if they are only in play "If font linking is enabled on your device,"

                  If Font Linking is not "enabled" and Font Fallback is in play, how is that implemented differently in the two OSs and can I direct Windows7 to use the Sergoe UI Symbol ?

                  (Some rabbit hole this one!)
                  Rgds, Dave


                  • #10
                    Thanks for the additional depth of information. As Dominic said, the transparency of the display process can be misleading. So your explanations will be useful when working with it in the future.


                    • #11
                      And, Dominic,
                      It's good to hear from you again.The more often you post, the better off our forum is!


                      • #12
                        Hey Dave,
                        I don't have a Win7 machine to test the code on. What do the characters look like on Win7? Drastically different, or just slightly different?


                        • #13
                          Hi Gary,

                          Not too different, but Segoe UI Symbol (Win10) looks better? ..

                          Rgds, Dave