Valhalla Legends Forums Archive | Visual Basic Programming | combining diacritical marks

AuthorMessageTime
yuleball
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?
December 31, 2008, 7:20 AM
BreW
Sure, get the value of that character then replace it with the diactrical version.
e -> é

I'm not sure about consonants or anything that the default character map doesn't support, though.
Besides, why would you want to accent your H? heh.

If you actually do, however...
....
you'd have to paint it on your own.
Finding the position of the character to accent is half the battle-- the way i'm thinking of is something like this:
1). Store the position of any character marked diactrical within the richedit control
2). Update this position whenever the text is modified
3). On paint, get the current scroll position, the current font's character height, and determine what range of lines is being displayed.
4). If a diactrical letter is being displayed, find the x,y coordinates of it.
5). The y coordinate can be found by multiplying the character height by (current line - first line in range)
6). The x coordinate can be found by using GetTextExtentPoint() on the all the text in the current line leading up to that letter.
7). SetPixel() out the shape of an accent mark over that specific character.

In other words, ugly.
December 31, 2008, 3:21 PM
yuleball
Actually, I'm developing urdu editor. In urdu If i want to store the characters with diacritics there would be billions of fonts. I have developed separate fonts for diacritic and base characters using Scanfont and fontlab.
January 1, 2009, 7:07 AM

Search