Solved

Overscores in RichText format

Posted on 2002-05-20
15
1,158 Views
Last Modified: 2012-05-04
(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.
0
Comment
Question by:trovatore
15 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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)
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Update:
Finally got to wotsit, downloaded the latest RTF specs, and saw no mention of any overline support.
0
 

Author Comment

by:trovatore
Comment Utility
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.
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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?
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Apparently the text is not posted as Arial as it is in this text entry box (those letters above appeared with overlines)
0
 

Author Comment

by:trovatore
Comment Utility
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.
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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).
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:trovatore
Comment Utility
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.
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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.
0
 

Author Comment

by:trovatore
Comment Utility
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.
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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?
0
 

Author Comment

by:trovatore
Comment Utility
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.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Expert Comment

by:bobbyb30q
Comment Utility
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now