guillep2k
27th March 2002, 15:15
Hi!
I'm trying to render fonts over a memory bitmap (not to be show on the screen) to be used for DVD subpictures. DVD subpictures are usually 720x480, but are supposed to display in a 4:3 aspect ratio, so I must expand fonts horizontally by 12.5% when using a 1:1 memory device context. My problems are two, as follows:
1) The main problem is the accuracy of the LOGFONT structure. Since I'm typically using -22 as the tmHeight, I'm obtaining AveCharWidths of about 12. A 12.5% increase should give me a new width of 13.5, but since tmWidth is integer, I can only use a value of 13 or 14, which gives me a bad aspect ratio correction. Is there a way of using more precise values (a smaller scale, like tenths of a logical unit) in the LOGFONT structure? I cannot use larger fonts, because then I would have to downscale the resulting bitmaps with a considerable loss of quality (I cannot use anti-alias since the targer is monochrome).
2) I'm using the CreateCompatibleDC function to get a DC to work with, but I have no warranty that the screen DC will give me square (1:1) pixels. How can I get a working DC with the desired pixel shape (aspect ratio)? (If I can do this, point 1 would be covered too).
Thanks in advance,
Guille
I'm trying to render fonts over a memory bitmap (not to be show on the screen) to be used for DVD subpictures. DVD subpictures are usually 720x480, but are supposed to display in a 4:3 aspect ratio, so I must expand fonts horizontally by 12.5% when using a 1:1 memory device context. My problems are two, as follows:
1) The main problem is the accuracy of the LOGFONT structure. Since I'm typically using -22 as the tmHeight, I'm obtaining AveCharWidths of about 12. A 12.5% increase should give me a new width of 13.5, but since tmWidth is integer, I can only use a value of 13 or 14, which gives me a bad aspect ratio correction. Is there a way of using more precise values (a smaller scale, like tenths of a logical unit) in the LOGFONT structure? I cannot use larger fonts, because then I would have to downscale the resulting bitmaps with a considerable loss of quality (I cannot use anti-alias since the targer is monochrome).
2) I'm using the CreateCompatibleDC function to get a DC to work with, but I have no warranty that the screen DC will give me square (1:1) pixels. How can I get a working DC with the desired pixel shape (aspect ratio)? (If I can do this, point 1 would be covered too).
Thanks in advance,
Guille