hi I am designing an editor program. I am using ChrW() and AscW() functions to print the character on screen. I want to implement combining diacritical marks(or accent marks) i-e if i print a character and then i want to put diacritic on it by using specific key then i shud be able to place diacritic above or below that character so that they appear as one character. Is there any way to accomplish this in vb?

Recommended Answers

All 2 Replies

Certainly.... If you know the ascii value that corresponds to the diacritical mark. For example, I can change e to é or ë by doing something like:

letter = chrw(233)
letter = chrw(235)

However, there is no built in functionality to take a character and simply combine a diacritical mark resulting in the new character.
What I would do, is build a real simple program that has two textboxes on it. Then, I would put a button on it with some code like:

text2.text = ascw(text1.text)

Then in windows, go to start, run, type in charmap. Then find the modified version of each letter that you want to add, put it in the textbox, and click the button... it will give you the ascw value of the diacritical mark/letter mix. (like é = 233 or ë = 235). Then you store these in an array or collection or something. Then, when they highlight "e" and click say Umlaut or Grave, you basically do a simple if. so like, if highlighted_letter = "e" and Umlaut was clicked, then change e to chrw(235).
I think where most of the work is going to come in, is that there is no (from what I can see) stand-alone accent marks. For example, I can't just make the Umlaut mark right now by itself... I can make the O or E combined with Umlaut, but not just two dots side by side. On the button caption, you could probably get away with using two periods (..) but it seems sort of low and might make you crazy. So, the only way I can see making the buttons that represent the unmixed diacritical, would be to make them yourself in like paint or some kind of drawing program (and make them kinda small) and use them as the graphical face of the button (Change the button's style to graphical, and use it as the picture).

Hopefully this helps some.

I hav developed my own fonts using fontlab and scanfont and my fonts contain separate base characters and diacritical marks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.