Dmian I'm now working on the glyphs for Bescii. Here's a little preview. I wanted to check with you to see if I'm on the right path. If you see something that looks weird or needs to be changed, let me know.

Thank you! Everything looks familiar and readable to me. I don't see anything I'd like to fix.

6 days later

Please, try the beta of v2.0 of Bescii and tell me if you see anything wrong with it:

https://github.com/damianvila/font-bescii/releases/tag/v2.0-beta

I had to re-create the whole font, so I took the opportunity to fix a few things and add the requested features. But I used a different workflow, so I hope nothing's messed. I kindly appreciate if you can help me by checking that everything is ok.
Thank you!

As a reminder (Have I actually mentioned that anywhere?): You can use LOAD FONT <filename$> to load TTF fonts and select them with FONT <name$> SIZE <x>, <y>. (The name is the file's base name without extension.)

    uli Oh! Right. Yes, yes you did. And I totally forgot… 😝.
    I’m going to check it, and if everything goes ok, I’ll make the official release. (I already modified a few things I discovered).
    Next weekend I’ll do Lexis. Cheers!

    Everything seems to be in order. We go with the release. 😊

    Tested with the desktop version, works well there too:

    Btw: @uli While trying to generate this second image, I configured the system with the Spanish keyboard layout, but seems to be mapped wrong?
    I checked TKeyboard.cpp (and the sdl one) and think some of the mappings are wrong. But I see some U and backslashes around that I have no idea what they do, and I'm afraid to break anything if I modify it. How can I help you correct it? So far I've identified 4 wrong keys.

    • uli replied to this.

      Here's what I got. I think it looks good. I still don't really like the way the capital letters "Ё" and "Й" look, but I realize it's almost impossible to do anything with them given the limited height. But those are letters that are pretty rarely used as capitals, so I think it's okay to ignore them.

      Thanks again for your work!

      @uli Please add Russian keyboard layout to next release.

        CityAceE I still don't really like the way the capital letters "Ё" and "Й" look, but I realize it's almost impossible to do anything with them given the limited height.

        Exactly. There’s not much you can do with a 8x8 grid. I tried my best.

        I picked up the new font and the keyboard layout, but they might only show up in tomorrow's build.

        Dmian Btw: @uli While trying to generate this second image, I configured the system with the Spanish keyboard layout, but seems to be mapped wrong?
        I checked TKeyboard.cpp (and the sdl one) and think some of the mappings are wrong. But I see some U and backslashes around that I have no idea what they do, and I'm afraid to break anything if I modify it. How can I help you correct it? So far I've identified 4 wrong keys.

        Since the Spanish layout happens to be the last of the built-in layouts, we could simply drop it and add a keyboard layout file like the Russian one instead...

          uli Ok, perfect. I'll check the repo and look at the Russian file to see if I can make a similar Spanish file. I'll let you know. Thanks!

          @uli Ok, now I'm actually confused. I found what looked like a nice tool to check the scan codes: https://kbdlayout.info/kbdsp/scancodes
          But when I compared it with the info: https://wiki.libsdl.org/SDL2/SDL_Scancode
          They don't match at all. 😣
          It makes things a bit confusing because all documentation is for ANSI 104 keyboards, and here we use ISO 105 keyboards...
          For example, my keyboard layout looks something like this:

          I have no idea what the scan code is for the key marked in red (that doesn't appear in ANSI 104). Also, I don't know how to map the deadkeys in green. Can you help me solve this problem?

            Ok, this is what I have:

            spanish.zip
            417B

            I think the code for the missing key is 100 (0x64).
            I put the deadkeys with a backslash before them. They're the two first characters at 0x2f and 0x34.
            If I need to do something else, let me know.

            • uli replied to this.

              @CityAceE Ok, I'm with the Lexis (6x8) characters now.
              This is what was previously:

              And this is the new version:

              I used the reference you sent me. I tried to make the "Ё" and "Й" different between caps and lowercase as much as I could. In the case of "Й" that's the way it was in the reference. Tell me what you think, and if you prefer a specific character from the old version, rather than the new.

              @Dmian Thank you! I like the new version a lot. I wouldn't change a thing about it.

              Dmian I put the deadkeys with a backslash before them. They're the two first characters at 0x2f and 0x34.
              If I need to do something else, let me know.

              I just sat down to spend five minutes on implementing dead keys, but I quickly realized that that may not be entirely trivial after all...

              We don't just need the dead keys themselves but also all combined characters that can be formed using the dead keys. I took a look at the Linux key map definitions, and they simply have values like "dead_acute" that magically do the right thing, i.e. the semantics of these keys are implemented "somewhere else", possibly hard-coded.

              So I have (at least) several questions:

              1. Are the combined characters that are formed for a specific dead key (e.g. acute, grave, circumflex) the same for every keyboard layout in the entire universe, or are there exceptions? (I have not looked into that, but I would bet on the latter...)
              2. If there are exceptions we need to encode all the combined characters in the key map. Any suggestions on how to go about that?
              3. How do those keys in the layout above work that are dead keys but also have AltGr bindings (e.g. [)? I assume that those are semi-dead keys that are only dead for certain modifier states, right?

                uli I just sat down to spend five minutes on implementing dead keys, but I quickly realized that that may not be entirely trivial after all...

                He, he, I thought that may be the case... 😅

                uli Are the combined characters that are formed for a specific dead key (e.g. acute, grave, circumflex) the same for every keyboard layout in the entire universe, or are there exceptions? (I have not looked into that, but I would bet on the latter...)
                If there are exceptions we need to encode all the combined characters in the key map. Any suggestions on how to go about that?

                The combination is a bit complex, to be fair. I think it's better to use an example:

                There are three elements in using diacritics: The diacritic alone, the glyph alone and the glyph with diacritic. An example of how you obtain the combined character:

                Let's take "A". Its unicode number is \u0041. Now let's take the grave accent "`", \u0060. The way to get the A-grave character ("À" \u00C0) is to type the dead key "grave" (0x2f) and then "A" (0x04). In Spanish systems, and I guess is similar in languages with layouts that use dead keys, you normally get a visual indication that you've pressed a dead key:


                That is the grave character alone (\u0060) with an indication of some sort (in this case, a blue underline). If you then press a key that can be combined, it will put that combination, for example "À" if you type "A" after the dead key, if you press space it will put the grave character alone "`", and if you press a key that can't be combined, you get both characters "`T" (for example if you pressed "T" after the grave dead key).

                Now, some fonts have already combined characters. For example, the unicode A-grave is \u00C0. So, if you press the grave dead key and then "A", you should always get \u00C0 (À), and it's the same for the rest of the combined characters.

                But here it gets complex: there's also a combination grave character, \u0300. It works like old typewriters if the font doesn't include the combined character: the character includes a virtual backspace, and allows for superposition, so you print the combination grave (and the cursor stays in place) and you superimpose the regular "A" character.

                But I do include the already combined characters in all the fonts I make, so I think that can be ignored, if you want. It's an old mechanism inherited from typewriters.

                So the process should be: get the dead key, print the diacritic with some indication (underline, inversion, etc) and then get the second key (could be lowercase, uppercase -shift+lowercase-, space or any other key), find in a table if there's a corresponding character for that combination (say \u00C0 if "A" was pressed after a grave dead key) and replace the accent with the combined character. If there's no combined character, just print the second character following the accent (or just the accent if space was pressed) and remove the "deadkey-pressed" indicator.

                For every diacritic, there's only one possible outcome if there exists a combination. So for "`", "´", "¨", "^", "~" and "˚" if you press "A", you'll always get À, Á, Ä, Â, Ã, Å, and the same goes for E, I, O, U in Spanish, including lowercase. (Funnily, I had to copy "˚" from a web page, since my keyboard is unable to create that dead key, that's included in Nordic languages).

                In Spanish there's also a funny one: Ñ. We have a dedicated key for it (0x33), but it can also be obtained by pressing the "~" dead key (AltGr + Ñ) and then "N" key after that. So much for redundancy! 😆

                For the Latin alphabet, I always create combined characters for the letters A, E, I, O, U, W, Y and N (N tilde, or Ñ)

                uli How do those keys in the layout above work that are dead keys but also have AltGr bindings (e.g. [)? I assume that those are semi-dead keys that are only dead for certain modifier states, right?

                Yes, for "`" (0x2f) and "´" (0x34), they're dead keys when pressed alone or with Shift ("^" and "¨" respectively), but work as normal keys when used with AltGR, where you obtain "[" and "{" respectively.

                These are the three states of my keyboard:

                Normal, with the two dead keys:

                Shift (same dead keys, but different diacritics):

                And AltGr (the only diacritic in the Ñ key):

                That's why I put the diacritics in the Spanish conf file with a backwards slash (\`, for example), the idea being that if you find that, you understand it's a dead key, and what diacritic to combine (the one right after the backwards slash) to get the appropriate result, but I don't know if it's the correct idea. In any case, you need a table of combined characters, to print for the dead keys combinations. If you need it, I can make you a list of the combined characters, and what the combination is (like `+A: À, ´+e: é, ^+i: î, etc).

                Damn! Never thought that explaining diacritics was so exhausting... 😅

                This is interesting information! Thank you!!! I've never thought about how characters with "lids" are typed in other languages. In Russian, only two characters have "lids" ("Ё" and "Й"), but they have separate keys. And many people simply ignore the letter "Ё" and use "Е" instead. I am of the opinion that if there is a letter, it should be used and I always use "Ё". There are only a few words in the Russian language where these letters are used as first letters. Therefore, mostly capitalized versions of these letters are used in cases where the whole word is printed in capital letters.

                4 days later

                Powered by: FreeFlarum.
                (remove this footer)