• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1237
  • Last Modified:

Overscores in RichText format

(actually a VC++ app, but most RichText questions seem to wind up here)

I need to be able to put a line *over* a character in RichText.  I find it somewhat bizarre that this isn't just standard; according to the MSDN docs you can do underlines, double underlines, *wavy* underlines, dot-dot-dash underlines, but overlines aren't mentioned.

But no use crying about that, I guess.  Surely there must be a way around it.  Can I, say, put a dash as a superscript, with a negative space before it?  How do you do negative spaces in Rich Text, if it's possible?

To clarify, what I'm interested in is how to produce the ASCII code for the rich text; e.g., to put an underline
before a character x, you'd do \ul x \ul0.  I want to
know how to do an overline.
1 Solution
Seems logical that it would just be "ol", but you could probably find out for sure by downloading the rtf code specs from www.wotsit.org (site was down when i tried to visit it just now, however)
Finally got to wotsit, downloaded the latest RTF specs, and saw no mention of any overline support.
trovatoreAuthor Commented:
Does seem logical, doesn't it?  But it ain't so.  I
appreciate the tip for the specs, but there is just
no "overline" there in parallel with "underline", and
so what I really need is a workaround, like a
negative space or something.
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

I'm not really sure of any workaround...never heard of anything like a negative space or the like.  How would you achieve this in MS Word?  I couldn't even figure that out, and rtf documents are less complex/powerful than word documents.

Do you need this functionality over any letter?  If only certain ones, the font you use may already have the ability to display certain letters with that ability (e.g. in Arial, â, ç, î)

Will these documents need to be printed, saved, reopened for later use, or is this strictly a display thing?
Apparently the text is not posted as Arial as it is in this text entry box (those letters above appeared with overlines)
trovatoreAuthor Commented:
I need it over an x, a y, and a mu (that's
an m in Symbol font).  It needs to be
in RichText format that other applications
can display.
Well, it may be a start, but it appears the Symbol font has an overline character (I was able to use it and write another character below it in Word).  It has the character code 96. You may be able to just alter the font to Symbol, write that character code, and then your letter (x, y, or mu <~~ staying in Symbol font if necessary).  I have yet to try and actually implement the code using the RichTextBox, but I did it by simply typing in Word, so that may be a start (save as RTF and view the rtf code in Notepad).
trovatoreAuthor Commented:
I can't get it to appear directly over the character.
It seems to be either before or after.  That's
what I wanted the negative space for.
Checked when I got home...
With Word 2000 I can get it to appear above a letter by simply first typing the overline character, use my arrow key to move back under it, and then type any letter.  However, I save as RTF and view it in WordPad, and it no longer appears under the overline character.  This tells me that maybe something in the latest .doc specs allows this, but RTF still does not support it.

AFAIK, the last option may be to find a font that automatically supports these needed characters, and just distribute it with your application.
trovatoreAuthor Commented:
No, I'm afraid that doesn't work for us.  Actually we
*have* such a font; we're trying to get rid of it, because
it causes problems for Asian users, and because if you
send stuff to a third party that doesn't have our program,
he sees nonsense characters.  That's the whole point of
using RTF.
Well remember you are sometimes limited by technology, and I'm sure you can respect that.  I am just spitting out ideas...sometimes the answer comes from looking elsewhere instead of right at the light.

Is this some sort of equation creator (the x's and y's and mu's are causing me to assume).  Have you considered generating an image for these equations, since you can easily embed those into an rtf document?
trovatoreAuthor Commented:
Yeah, I've thought about that.  It's not ideal, because
we'd like the user to be able to choose a font size, but
it's not horrible because there are not that many cases
where these overscore characters are used.

I should clarify my earlier comment -- the users who are
inconvenienced by the font are not Asian users per se, but
users running Asian-language versions of Windows.  I
expect that was clear enough, but just to be sure.
Hi trovatore,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

trovatore, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
DanRollins -- EE database cleanup volunteer
per recommendation

Community Support Moderator @Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now