Solved

Overscores in RichText format

Posted on 2002-05-20
15
1,177 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
ID: 7021616
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
ID: 7022163
Update:
Finally got to wotsit, downloaded the latest RTF specs, and saw no mention of any overline support.
0
 

Author Comment

by:trovatore
ID: 7022186
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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 28

Expert Comment

by:AzraSound
ID: 7022232
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
ID: 7022235
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
ID: 7022242
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
ID: 7022562
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
 

Author Comment

by:trovatore
ID: 7022644
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
ID: 7022671
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
ID: 7022855
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
ID: 7023025
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
ID: 7023041
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
ID: 7818265
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
ID: 7909738
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Expert Comment

by:bobbyb30q
ID: 24648915
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

830 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