Announcement

Collapse
No announcement yet.

Appropriate Fonts for a dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Appropriate Fonts for a dialog

    Hi all, being new in programming I have been using the ARIAL font and sometimes ARIAL Unicode MS in my dialogs.
    On this forum, I found that some members are using Segoe UI and Tahoma and I have began testing them out and found them to be better refined than ARIAL
    which is fat and big?

    Hence, what would be the most appropriate fonts that you experienced programmers would use for your dialogs?
    appreciate your comments on this

  • #2
    Segoe UI (9pt) is the default font for dialogs in Windows 10 (In WIn11, it's "Segoe UI Variable")
    The default used to be Tahoma on earlier WIndows versions.
    Unless you have a reason to change it, it's best to stick with it.
    For more info, see:
    https://docs.microsoft.com/en-us/win...uide/vis-fonts

    Note from that link:
    If you do only one thing...
    Respect the user's settings by always using the system font, sizes, and colors.

    Comment


    • #3
      At 8, 9 or 10 points for labeling in images (using like MS Paint) ARIAL works well.

      Used Tahoma many times in HTML. Cosolas is monospaced, so is handy for PBCC and source code in HTML.

      Lately have often been using Microsoft Sans Serif for PBWin dialogs/controls. (Do not confuse it with MS Sans Serif which is ANSI only (you are now using WSTRINGs, right?))

      Cheers,
      Dale

      Comment


      • #4
        Originally posted by Dale Yarker View Post
        Lately have often been using Microsoft Sans Serif for PBWin dialogs/controls. (Do not confuse it with MS Sans Serif which is ANSI only (you are now using WSTRINGs, right?))

        Cheers,
        Not to mention that MS Sans Serif is real skinny and looks like sh*t as well as not having many of the higher ANSI characters common in Western Code Pages such as CP 1252.
        Click image for larger version  Name:	SansSer.jpg Views:	0 Size:	145.7 KB ID:	818092

        Comment


        • #5
          Had considered editing my previous post to mention Character Map Accessory, now I don't have to
          Dale

          Comment


          • #6
            If you want to use different symbols other than standard alphabetic characters, it's worth considering how many different glyphs there are in each of the fonts:
            Microsoft San Serf and Segoe both have around 3,000
            Arial Unicode MS has over 51,000

            Comment


            • #7
              The general drift with font choice is to use a font that is available in the OS, nothing custom or other users will not get the correct display. Nothing beats eyeballing the result, try different fonts of different weights and sizes until you get one that looks the way you want.
              hutch at movsd dot com
              The MASM Forum - SLL Modules and PB Libraries

              http://www.masm32.com/board/index.php?board=69.0

              Comment


              • #8
                If you want to use a font that is not available by default in WIndows, it's trivial to include it in your application as RCDATA and create and use a memory resident font in your application. Just call AddFontMemResourceEx. https://docs.microsoft.com/en-us/win...tmemresourceex

                Click image for larger version  Name:	Clock.jpg Views:	0 Size:	13.6 KB ID:	818098

                DSEG7Modern-Bold.ttf is in the attached zip along with the source file.
                '
                Code:
                #COMPILE EXE "7SegClock.exe"
                #DIM ALL
                %UNICODE = 1
                #INCLUDE ONCE "WIN32API.INC"
                #RESOURCE RCDATA, ResFont, "DSEG7Modern-Bold.ttf" '
                
                ENUM ctrls SINGULAR
                    IDC_Minutes = 1001
                    IDC_Seconds
                    IDC_Date
                END ENUM
                
                GLOBAL ghResFont AS LONG
                GLOBAL ghFont1 AS DWORD
                GLOBAL ghFont2 AS DWORD
                
                FUNCTION PBMAIN() AS LONG
                      ghResFont = AddMemResFont("ResFont")
                      ShowClock 0
                END FUNCTION
                
                FUNCTION SHowClock (hParent AS DWORD) AS LONG
                    LOCAL lRslt,BGColour AS LONG
                    LOCAL hDlg AS DWORD
                    FONT NEW "DSEG7 Modern", 24, 1, %ANSI_CharSet TO ghFont1
                    FONT NEW "DSEG7 Modern",12, 1, %ANSI_CharSet TO ghFont2
                    BGCOlour = RGB(220,248,255)
                    DIALOG NEW hParent, "Clock",,, 120, 56,%DS_MODALFRAME OR %WS_BORDER OR %WS_CLIPSIBLINGS _
                                                                 OR %WS_DLGFRAME OR %WS_POPUP OR %WS_SYSMENU OR %WS_MINIMIZEBOX  TO hDlg
                        CONTROL ADD LABEL, hDlg, %IDC_Minutes, "", 10,5,75,20
                        CONTROL ADD LABEL, hDlg, %IDC_Seconds, "", 90,12,20,10
                        CONTROL ADD LABEL, hDlg, %IDC_Date, "", 14,40,100,20
                
                        DIALOG SET COLOR hDlg,-1,BGColour
                        CONTROL SET FONT hDlg, %IDC_Minutes, ghFont1
                        CONTROL SET COLOR hDlg,%IDC_Minutes, %BLUE,BGColour
                        CONTROL SET COLOR hDlg, %IDC_Seconds, %BLUE,BGColour
                        CONTROL SET FONT hDlg,%IDC_Seconds, ghFont2
                        CONTROL SET COLOR hDlg, %IDC_Date, %BLUE,BGColour
                        CONTROL SET FONT hDlg,%IDC_Date, ghFont2
                
                    DIALOG SHOW MODAL hDlg, CALL MainDlgCB TO lRslt
                END FUNCTION
                
                CALLBACK FUNCTION MainDlgCB()
                    LOCAL strT1 AS STRING
                    STATIC strT2 AS STRING
                    LOCAL strT3 AS STRING
                    STATIC COLONON AS LONG
                
                    SELECT CASE AS LONG CB.MSG
                        CASE %WM_INITDIALOG
                            settimer CB.HNDL, 1,500,0
                            colonon = -1
                            strT1 = LEFT$(TIME$,5)
                            strT2 = RIGHT$(TIME$,2)
                            CONTROL SET TEXT CB.HNDL ,%IDC_Minutes, strT1
                            CONTROL SET TEXT CB.HNDL ,%IDC_Seconds, strT2
                            CONTROL SET TEXT CB.HNDL,%IDC_Date,RIGHT$(DATE$,4) & "-" & LEFT$(DATE$,2) & "-" & MID$(DATE$,4,2)
                            settimer CB.HNDL, 1,500,0
                            strT2 = LEFT$(TIME$,5)
                
                
                        CASE %WM_TIMER
                            IF CB.WPARAM = 1 THEN
                                strT1 = LEFT$(TIME$,5)
                                strT3 = RIGHT$(TIME$,2)
                                IF strT1 <> strT2 THEN 'if minute has rolled over
                                    strT2 = strT1
                                    CONTROL SET TEXT CB.HNDL,%IDC_Date,RIGHT$(DATE$,4) & "-" & LEFT$(DATE$,2) & "-" & MID$(DATE$,4,2)
                                END IF
                                IF colonon THEN
                                    colonon = 0
                                ELSE
                                    REPLACE ":" WITH " " IN strT1
                                    colonon = -1
                                END IF
                                CONTROL SET TEXT CB.HNDL ,%IDC_Minutes, strT1
                                CONTROL SET TEXT CB.HNDL ,%IDC_Seconds, strT3
                            END IF
                
                        CASE %WM_DESTROY
                            FONT END ghFont1 ' end font
                            FONT END ghFont2 ' end font
                            RemoveFontMemResourceEx(ghResFont)
                
                    END SELECT
                END FUNCTION
                
                FUNCTION AddMemResFont(sResName AS WSTRING) AS LONG
                    LOCAL sBuffer AS STRING
                    LOCAL numfonts  AS LONG
                    IF sResName = "" THEN EXIT FUNCTION
                    sBuffer = RESOURCE$(RCDATA, sResName)
                    FUNCTION = AddFontMemResourceEx( STRPTR(sBuffer), LEN(sBuffer), %NULL, numfonts)
                END FUNCTION
                '
                Attached Files

                Comment


                • #9
                  Thank you Sir Stuart, where can I download the ttf files so that I can use other types of fonts?

                  Comment


                  • #10
                    put free font ttf file download in Google and pick one.
                    I typed "free ttf" and that popped up as a choice
                    Dale

                    Comment


                    • #11
                      Some time ago I needed some specialised fonts so after downloading a few of the free ones that had missing characters and were squarking for money, I found a source that had 10 thousand fonts so I bought the package. The next PHUN part was wading through a massive number of fonts to find the ones that were useful.

                      The only catch with adding a TTF or OTF font to a resource section is you app gets bigger by the size of the font.
                      hutch at movsd dot com
                      The MASM Forum - SLL Modules and PB Libraries

                      http://www.masm32.com/board/index.php?board=69.0

                      Comment


                      • #12
                        Originally posted by Tim Lakinir View Post
                        Thank you Sir Stuart, where can I download the ttf files so that I can use other types of fonts?
                        Font Squirrel and 1001 Fonts are very popular sites and are almost universally top picks in "best free font sites" articles.

                        Comment


                        • #13
                          Be careful of what you wish for, most things are worth the price you pay for it. While you may be lucky in download free fonts, you can also get junk that does not work well or is not complete. There are big collections available that cost peanuts, $20 USD or similar. Saves a lot of wasted time testing fonts.
                          hutch at movsd dot com
                          The MASM Forum - SLL Modules and PB Libraries

                          http://www.masm32.com/board/index.php?board=69.0

                          Comment


                          • #14
                            Those $20 font bundles are the same fonts that you find on sites like 1001 Fonts and Font Squirrel. A lot of them are pretty rough and limited in the glyphs available.. You are just paying the seller for indiscriminately grabbing a bunch of free fonts and consolidating them into a zip file. And many of them will only be free for personal use. If you use them commercially, you are supposed to licence them separately

                            It's actually more convenient and you get a better selection by using one of those site's search engine to narrow down what you are looking for, view them online, including the licencing, and just download the one(s) you want.

                            Comment


                            • #15
                              I have no doubt you have exhaustively tested the entire range of paid font downloads to make an observation of this type.

                              > A lot of them are pretty rough and limited in the glyphs available.

                              Strange I have never had that problem out of the 10 thousand I have available, I have probably picked my way through some hundreds of them over time and none of them suffered from the problems you imagine. The virtue of buying them is you have them locally and can very quickly scan through them using the standard Windows display to see what they look like. Certainly beats some sloppy and slow interface with money squarking along the way.
                              hutch at movsd dot com
                              The MASM Forum - SLL Modules and PB Libraries

                              http://www.masm32.com/board/index.php?board=69.0

                              Comment


                              • #16
                                Essentially, I only use its three fonts.
                                From what I understand they are modern and have been developed on behalf of Microsoft and therefore should be included in newer Windows version.
                                I recommended them.
                                Click image for larger version

Name:	Typsnitt.png
Views:	83
Size:	36.8 KB
ID:	818107
                                Fim Wästberg

                                Comment


                                • #17
                                  Originally posted by Fim Wästberg View Post
                                  Essentially, I only use its three fonts.
                                  From what I understand they are modern and have been developed on behalf of Microsoft and therefore should be included in newer Windows version.
                                  I recommended them.
                                  For a full list of the dozens of fonts that come with WIndows and details of the first WIndows version that they came with, see https://docs.microsoft.com/en-us/typography/font-list/
                                  Each font there has a description page, many of which explain the features and suggests areas where the font would be useful.


                                  Comment


                                  • #18
                                    I have read https://docs.microsoft.com/en-us/typography/font-list/ for some fonts.
                                    Microsoft's recommendation to use Cambria for on-screen reading is, quite frankly, completely wrong according to my typographic knowledge.
                                    I strongly recommend the following rules, it was what Tim Lakinir wanted.
                                    1 Use Calibri for screen.
                                    2 Use Cambria for paper.
                                    3 Use Consolas for tables, layouts, program code.
                                    Fim Wästberg

                                    Comment


                                    • #19
                                      Very informative, Thank you Everyone

                                      Comment

                                      Working...
                                      X