|
Post by (X) on Feb 24, 2022 19:58:19 GMT 1
Have you ever wanted to write Pi or Tau or Phi in your program code because it's "cool" to use the actual Greek letters used by scientists and mathematicians?
Apparently, you may only have to select the Greek script in the GFA Code Editor menu: Extra -> Properties -> Font.
I have noticed major difference when choosing a font family or name, for example: Courier vs Consolas. You will have to evaluate each font individually for the desired outcome because fonts in general are not universally equivalent.
From then on, you should be able to call up the desired Greek letter with Alt+<ascii code> combination. You may be able to use 2 numerals but 4 numeral including the leading 0's are most consistent. Sometimes lower numbers without leading 0's map to a higher Extended ASCII value whereas the 4 numeral code always return the same character.
In the following code, the form: frm1's font script (or Charset) is changed to Greek - in code - so the symbol for Pi can be printed as a Greek letter on the form. You can also change a form or other control's font script or charset to Greek in the form editor's Properties -> Font section.
LoadForm frm1 frm1.AutoRedraw = 1 Const Greek = 161 Dim fnt As New StdFont fnt.Name = "Consolas" fnt.Charset = Greek Set frm1.Font = fnt
Dim ð = PI
Print " PI = ð ="; ð
Do : Sleep : Until Me Is Nothing
Based on:
|
|
|
Post by (X) on Feb 25, 2022 14:45:04 GMT 1
How can I call-up a popup menu to let me insert Greek characters from a menu instead of memorizing arcane Alt-codes?
The GFA IDE Editor Extension is a POWERFUL utility that is 'built-in' and is accessible via <user defined filename>.GLL files that the user can add-on to his existing GFA IDE Code Editor via the Extra-> Extension Manager menu section (Ctrl-M).
From GFA Help: Editor Extension Reference
If you:
Now, when you press: Shift+Ctrl+G a Popup menu will appear, from which you can select your favorite Greek letter to be inserted at the current cursor position. I know "Error" (±) is not technically a Greek letter but it is often used to indicate the Error margin.
So, now you can see how easy it is to setup any kind of popup menu ready to insert text in the editor or perform a task. You are practically only limited by your imagination.
|
|
|
Post by (X) on Feb 27, 2022 10:14:58 GMT 1
I am going to look into the possibility of using Unicode characters for inserting special characters in Label, TextBox and RichTextFormat controls because - unlike the Print to screen statement - I have noticed that they do not seem to care about the font 'charset' or 'script' setting. These websites seem like a good starting point:
After searching several websites, it is obvious there is no easy solution. Thankfully, I am in no rush to get this working.
|
|
|
Post by (X) on Feb 27, 2022 22:12:20 GMT 1
My findings so far... It seems: 1) You can "easily" Print to the form with Greek letters by selecting Greek Script/Charset. 2) You can use Alt+<4 number code> to insert a special character to a Rich Text Format control. 3) .Caption and .Text properties for Label, EditBox or TextBox don't seem to "care" about Charset or Alt+<code> input. So, you are stuck using the "Symbol" font or other font which contain the special characters you want, which makes mixing regular letters with symbols impractical. As in life when you are young and naive, some systems seem perfect and admirable, that is until you start digging a little. Then you realize Murphy's Law has had a big hand in making sure there are lots of inconsistencies and disharmony - just because they can exist.
There may be a clear dividing line between ANSI and UNICODE compatible controls, but I am struggling to see it.
|
|
|
Post by jj2007 on Feb 27, 2022 22:34:45 GMT 1
My findings so far... It seems: 1) You can "easily" Print to the form with Greek letters by selecting Greek Script/Charset. 2) You can use Alt+<4 number code> to insert a special character to a Rich Text Format control. 3) .Caption and .Text properties for Label, EditBox or TextBox don't seem to "care" about Charset or Alt+<code> input. So, you are stuck using the "Symbol" font or other font which contain the special characters you want, which makes mixing regular letters with symbols impractical. As in life when you are young and naive, some systems seem perfect and admirable, that is until you start digging a little. Then you realize Murphy's Law has had a big hand in making sure there are lots of inconsistencies and disharmony - just because they can exist.
There may be a clear dividing line between ANSI and UNICODE compatible controls, but I am struggling to see it.
It's a can of worms, but most Windows API functions dealing with strings have a W (=wide) version, meaning the UTF-16 equivalent of the A (=Ansi) version. Use them.
|
|
|
Post by (X) on Mar 2, 2022 1:30:18 GMT 1
I have tried to use the W (unicode) version of the API functions and have been able to make some slow progress.
If I understand correctly, GFA provides Wide() and Ansi() to convert from one to the other.
From GFA Help:
|
|
|
Post by (X) on Mar 19, 2022 15:27:42 GMT 1
I almost forgot about this utility: Charmap.
Here are a few Code Page / Character Encoding explanatory videos:
|
|