Click here to Skip to main content
15,914,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pointer to a function Pin
KingsGambit5-Jul-01 18:00
KingsGambit5-Jul-01 18:00 
GeneralRe: pointer to a function Pin
5-Jul-01 18:28
suss5-Jul-01 18:28 
GeneralRe: pointer to a function Pin
8-Jul-01 11:03
suss8-Jul-01 11:03 
GeneralRe: pointer to a function Pin
Oliver Anhuth8-Jul-01 20:53
Oliver Anhuth8-Jul-01 20:53 
GeneralCStringList and CList problem Pin
5-Jul-01 7:54
suss5-Jul-01 7:54 
GeneralDevice Context Pin
Ryan McFarren5-Jul-01 7:33
Ryan McFarren5-Jul-01 7:33 
GeneralRe: Device Context Pin
Tim Deveaux5-Jul-01 8:29
Tim Deveaux5-Jul-01 8:29 
QuestionHow can I have multiple fonts per line using DrawTextEX? Pin
Bart-Man5-Jul-01 6:23
Bart-Man5-Jul-01 6:23 
Greetings,

I was wondering how can I have multiple fonts per line using DrawTextEX?

I am stuck using DrawTextEX instead of TextOut(which you can use the msdn example "Drawing text from diferent fonts on the same line) due to a proprietary set of sdk functions which I cannot change that are built on DrawtextEX. Cry | :((

An approach that I have taken is that I have divided each line into seperate segments of text based upon what each segment should have for a font. Any font changes, and I place it in a seperate segment (which is a string array for now).

I then loop through the array and change the font of the dc to what the segment requires, and then I do a "DrawTextExtentPoint32" on each segment(array position), and use that to create my rect size per line to output the text. Which I follow with a call that is similar to DrawtextEx for outputting my text.

The PROBLEM I am having is that the I can't seem to get each text segment to draw so that it blends seamlessly. So that some text's rects draw the text in a higher Ascent than others. The result gives a line of text that draws the text starting in the corner, so that if a segment of text is a smaller font size than the next the smaller font text will appear higher on the screen than the next one.

If anyone knows of a better way to do multiple fonts per line using DrawTextEX, or a way to fix my rect feel free to drop me a comment. I am stuck right now. Confused | :confused:


Thanks in advance for any help!
AnswerRe: How can I have multiple fonts per line using DrawTextEX? Pin
Jim Crafton5-Jul-01 7:29
Jim Crafton5-Jul-01 7:29 
GeneralRe: How can I have multiple fonts per line using DrawTextEX? Pin
Bart-Man5-Jul-01 8:32
Bart-Man5-Jul-01 8:32 
GeneralFound a solution to the problem!! Pin
Bart-Man5-Jul-01 9:37
Bart-Man5-Jul-01 9:37 
GeneralDS problem Pin
Mihail5-Jul-01 6:02
Mihail5-Jul-01 6:02 
GeneralRe: DS problem Pin
Carlos Antollini5-Jul-01 6:17
Carlos Antollini5-Jul-01 6:17 
GeneralRe: DS problem Pin
Mihail5-Jul-01 6:54
Mihail5-Jul-01 6:54 
Generalado and excel Pin
Gérald Mercet5-Jul-01 5:39
Gérald Mercet5-Jul-01 5:39 
GeneralRe: ado and excel Pin
User 98855-Jul-01 6:16
User 98855-Jul-01 6:16 
GeneralRe: ado and excel Pin
Carlos Antollini5-Jul-01 6:26
Carlos Antollini5-Jul-01 6:26 
GeneralRe: ado and excel Pin
5-Jul-01 21:41
suss5-Jul-01 21:41 
GeneralRe: ado and excel Pin
User 98856-Jul-01 12:07
User 98856-Jul-01 12:07 
GeneralRe: ado and excel Pin
5-Jul-01 7:23
suss5-Jul-01 7:23 
QuestionHeader notifications? Pin
5-Jul-01 4:53
suss5-Jul-01 4:53 
AnswerRe: Header notifications? Pin
Tomasz Sowinski5-Jul-01 5:15
Tomasz Sowinski5-Jul-01 5:15 
GeneralRe: Header notifications? Pin
9-Jul-01 5:03
suss9-Jul-01 5:03 
QuestionHow can I hide a list control item? Pin
5-Jul-01 2:50
suss5-Jul-01 2:50 
AnswerRe: How can I hide a list control item? Pin
Tomasz Sowinski5-Jul-01 4:06
Tomasz Sowinski5-Jul-01 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.