I present you a simple implementation of the Western Latin font by including a small (3K) file with a precompiled routine.
To print text in Western Latin, the included routine must be called instead of the syscall function 4, using the same parameters.
Please look at the "PrintLatin.asm" example application to see the simplicity of it.
Notes:
- when assembling the example, you must adjust the paths of the includes.
- the file-suffix (o2i) stands for "object to include"
- the routine uses 6K stack space
- the routine is written in Mas (Modern assembly, a language still to be published, black box for now)
- to properly print accents, latin font characters are printed one pixel lower then the system font
I could add the option to use the system font if the user-language is Russian or implement code pages according the country.
Next to implement is a function to get a keyboard key with dead key handling.
Maybe then comes underlined text, Input fields, textbox, ... etc.
I would like your opinion on this approach (while waiting for the implementation of unicode).
Latin_o2i
-
- Attachments
-
-
Latin_o2i (3.15 KiB)
- File to include to print Western Latin symbols
Downloaded 233 times
-
Latin.jpg (6.89 KiB)Simple example Viewed 4625 times
-
PrintLatin.asm (3.9 KiB)
- Simple application to demonstrate the use of Latin_o2i (source)
Downloaded 232 times
-
PrintLatin (3.44 KiB)
- Simple application to demonstrate the use of Latin_o2i
Downloaded 225 times
-
Last edited by seppe on Mon Jun 16, 2014 10:59 am, edited 1 time in total.Greetings from Seppe
Interesting approach. And your font + routine is quite small, kudos!
Tried to use the routine in IRCC (IRC client) and noted that your procedure destroys registers, unlike mcall 4
Placing a pusha/popa around 'call prl' fixed the problems offcourse.
I'm not really waiting for 'a new language' but you seem to know your stuff. I'm curious.
PS: The actual printing of western text in IRCC failed because the built in UTF8 routine recodes to CP866 instead of 1252
Tried to use the routine in IRCC (IRC client) and noted that your procedure destroys registers, unlike mcall 4
Placing a pusha/popa around 'call prl' fixed the problems offcourse.
I'm not really waiting for 'a new language' but you seem to know your stuff. I'm curious.
PS: The actual printing of western text in IRCC failed because the built in UTF8 routine recodes to CP866 instead of 1252
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
Sorry ..I fixed it. I added a surrounding pusha/popa to the routine and updated the file.hidnplayr wrote:your procedure destroys registers, unlike mcall 4
I can improve Latin_o2i to accept and print utf8 for both CP866 (Russian) and CP1252 (Latin).hidnplayr wrote: printing of western text in IRCC fails because the built in UTF8 routine recodes to CP866 instead of 1252
Utf8, deadkeys, KB layouts, ... What shall i do first?
Greetings from Seppe
It's alive!
- Attachments
-
-
kolibrios.png (3.33 KiB)Viewed 4549 times
-
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
Bravo! Well done.
Now I will add a function to Latin_o2i to handle dead codes.
Soon to come . . .
Now I will add a function to Latin_o2i to handle dead codes.
Soon to come . . .
Greetings from Seppe
I present a second version of the "latin_o2i" routine in which I added deadkey handling.
To get a key, call the "latin" routine with eax=2 instead of the syscall 2 function.
An additional parameter (ebx) must point to a 12 byte structure (three 32-bit variables).
On return, eax contains the same result as the syscall 2 function, and the variables contain:
var 1 returns the ascii code, or 0 for deadkey, 1 if the controlkey is down, 2 for hotkey
var 2 contains the control key flags (see syscall 66,3).
var 3 is used by the latin routine to store the ascii code of the pending dead-key.
Please look at the "PrintLatin.asm" example application to understand the simplicity of it all. Notes:
- the routine works for all countries that use the Western Latin font for keyboard symbols.
- keyboard mode should be set to normal (the default)
- I did not (yet) test hotkeys
The latin routine applies simple "Typewriter" rules:
A dead-key that does not match a valid combination is lost.
To print a deadkey by itself, it must be pressed twice.
Use the AltNumkey method to enter any ascii code (see http://symbolcodes.tlt.psu.edu/accents/codealt.html for details)
I intent to make an application similar to Zkey for Latin keyboards.
I intent to make a map for Spanish keyboard, . . .
I will post a new topic on "printable keycodes".
On positive feedback, I'll publish a Fasm version of the latin_o2i routine.
To get a key, call the "latin" routine with eax=2 instead of the syscall 2 function.
An additional parameter (ebx) must point to a 12 byte structure (three 32-bit variables).
On return, eax contains the same result as the syscall 2 function, and the variables contain:
var 1 returns the ascii code, or 0 for deadkey, 1 if the controlkey is down, 2 for hotkey
var 2 contains the control key flags (see syscall 66,3).
var 3 is used by the latin routine to store the ascii code of the pending dead-key.
Please look at the "PrintLatin.asm" example application to understand the simplicity of it all. Notes:
- the routine works for all countries that use the Western Latin font for keyboard symbols.
- keyboard mode should be set to normal (the default)
- I did not (yet) test hotkeys
The latin routine applies simple "Typewriter" rules:
A dead-key that does not match a valid combination is lost.
To print a deadkey by itself, it must be pressed twice.
Use the AltNumkey method to enter any ascii code (see http://symbolcodes.tlt.psu.edu/accents/codealt.html for details)
I intent to make an application similar to Zkey for Latin keyboards.
I intent to make a map for Spanish keyboard, . . .
I will post a new topic on "printable keycodes".
On positive feedback, I'll publish a Fasm version of the latin_o2i routine.
- Attachments
-
-
PrintLatin.asm (5.59 KiB)
- Example application to demonstrate Latin°o2i (Fasm source)
Downloaded 222 times
-
PrintLatin (4.43 KiB)
- example application to demonstrate Latin_o2i (executable)
Downloaded 240 times
-
Latin_o2i (3.99 KiB)
- File with object to include
Downloaded 236 times
-
Greetings from Seppe
Who is online
Users browsing this forum: No registered users and 7 guests