How to show Super Script characters in angular material tooltip? - angular-material

I have a text like below
Treatment-Emergent Adverse Events <sup>a</sup> Terms Suggestive of Abuse Potential Leading to Study or Study Drug Discontinuation by Decreasing Frequency Safety Analysis Set
while showing it in matTooltip , tooltip text is showing as a but it should a as superscript character. but it is showing a as it is in the string.
How to resolve it.

Related

LaTeX footnote markers at beginning of word could benefit from kerning?

I'm using the manyfoot package in LaTeX to create a footnote apparatus. My question is about footnote markers that appear in the main body of the text (not about the footnotes as they appear in the apparatus).
The person I'm formatting this document for actually wants the main body footnote markers to appear before various words, not after, as you'd usually see. There's no problem doing this, but I'm seeing a particular effect I don't like with certain letters that begin some words. Here's an example so you can see what I'm talking about:
When the opening letter slopes, there seems to be too much space between the letter and the footnote marker. For comparison, here's a marker that comes before a non-sloping letter that looks nice:
So my question is this: Is there a way to introduce kerning or some sort of elastic spacing that would move the footnote marker closer to the opening letter of the word if the opening letter slopes? I think that would improve the look considerably.

how to set margins on NSAttributedText when converting from RTF

I'm converting some RTF text into an NSAttributedString using this code (Xamarin C#, but the same logic applies to Swift/Obj-C)
NSData data = NSData.FromString(RTFString);
NSDictionary opt = NSDictionary.FromObjectAndKey(NSObject.FromObject("NSDocumentTypeDocumentAttribute"), NSObject.FromObject(NSDocumentType.RTF));
NSDictionary docatt = null;
NSError error = null;
NSAttributedString sRTF = new NSAttributedString(data, opt, out docatt, ref error);
this works great, but when converting the RTF text it seems to set a default right margin value, so that the text is not flowing across the full width of the UILabel. There is no margin value set in the original RTF text.
How can I change or set the right-margin value of the resulting attributed text so that it flows across the entire width of my label?
Sample RTF
sample.rtf
{\\rtf1\\ansi\\ansicpg1252\\uc1\\htmautsp\\deff2{\\fonttbl{\\f0\\fcharset0 Times New Roman;}{\\f2\\fcharset0 Segoe UI;}}{\\colortbl\\red0\\green0\\blue0;\\red255\\green255\\blue255;\\red255\\green165\\blue0;}\\loch\\hich\\dbch\\pard\\plain\\ltrpar\\itap0{\\lang1033\\fs26\\f2\\cf0 \\cf0\\ql{\\f2 {\\b\\fs30\\cf2\\ltrch 1. Gum/Lip Irritation: }{\\fs24\\ltrch Whitening gel that comes into contact with gum tissue or the lips can become inflammed or bleached. The inflammation or whitening effect is temporary. You may feel a stinging and/or tingling sensation on these soft tissues during the treatment.2. Tooth Sensitivity: You may experience some tooth sensitivity during the first 24 hours after your treatment. Underlying tooth/gum disease such as existing sensitivity, cracked teeth, open cavities, leaking fillings, exposed roots or other dental conditions may worsen or prolong tooth sensitivity after treatment.3. Spots or Streaks: There is a potential to develop white spots or streaks on your teeth due to calcium deposits that naturally occur in teeth. These spots are not caused by Beaming White gel. The gel just brings these calcium deposits out and makes them more visible. This effect will fade over time.4. Relapse: After your treatment, it is natural for teeth color to regress over time. This relapse can be slowed down by avoiding staining agents such as coffee, tea, tobacco, red wine, colas etc. It is very important to avoid these staining agents, especially during the first 24 hours after treatment. I understand that the results of my treatment are not permanent, that up to 3 applications may be needed for desired effect and maintanence treatment every recommended very 4-6 months.}\\li0\\ri0\\sa0\\sb0\\fi0\\ql\\par}\r\n}\r\n}
Insert an extreme right margin (\margrXXXX), or one of just 0 should also work but does not always(?), to overide the default margin of your rtf string to allow the full width of your UILabel.Frame to be used for the paragraph reflow point.
Before:
After:
{\rtf1\ansi\ansicpg1252\uc1\htmautsp\margr20000\deff2{\fo...‌​

Aebacus Controls Negative Number Issue

I am working to flush out some defects from an older program and I'm running into an issue with negative numbers in aebacus textboxes.
Basically, whenever a negative number (i.e. -1) is entered into a textbox, on focus lost the textbox shows the number with a trailing negative (i.e. 1-). On focus again, the number is displayed correctly as -1.
I have seen this in excel and maybe it is a formatting setting, or possibly just a limitation of vb6?
Apparently using a different font can fix it, in our case we made a custom font to alleviate the issue.

What is a vertical tab?

What was the original historical use of the vertical tab character (\v in the C language, ASCII 11)?
Did it ever have a key on a keyboard? How did someone generate it?
Is there any language or system still in use today where the vertical tab character does something interesting and useful?
Vertical tab was used to speed up printer vertical movement. Some printers used special tab belts with various tab spots. This helped align content on forms. VT to header space, fill in header, VT to body area, fill in lines, VT to form footer. Generally it was coded in the program as a character constant. From the keyboard, it would be CTRL-K.
I don't believe anyone would have a reason to use it any more. Most forms are generated in a printer control language like postscript.
#Talvi Wilson noted it used in python '\v'.
print("hello\vworld")
Output:
hello
world
The above output appears to result in the default vertical size being one line. I have tested with perl "\013" and the same output occurs. This could be used to do line feed without a carriage return on devices with convert linefeed to carriage-return + linefeed.
Microsoft Word uses VT as a line separator in order to distinguish it from the normal new line function, which is used as a paragraph separator.
In the medical industry, VT is used as the start of frame character in the MLLP/LLP/HLLP protocols that are used to frame HL-7 data, which has been a standard for medical exchange since the late 80s and is still in wide use.
It was used during the typewriter era to move down a page to the next vertical stop, typically spaced 6 lines apart (much the same way horizontal tabs move along a line by 8 characters).
In modern day settings, the vt is of very little, if any, significance.
The ASCII vertical tab (\x0B)is still used in some databases and file formats as a new line WITHIN a field. For example:
In the .mer file format to allow new lines within a data field,
FileMaker databases can use vertical tabs as a linefeed (see https://support.microsoft.com/en-gb/kb/59096).
I have found that the VT char is used in pptx text boxes at the end of each line shown in the box in oder to adjust the text to the size of the box.
It seems to be automatically generated by powerpoint (not introduced by the user) in order to move the text to the next line and fix the complete text block to the text box. In the example below, in the position of §:
"This is a text §
inside a text box"
A vertical tab was the opposite of a line feed i.e. it went upwards by one line. It had nothing to do with tab positions. If you want to prove this, try it on an RS232 terminal.
similar to R0byn's experience, i was experimenting with a Powerpoint slide presentation and dumped out the main body of text on the slide, finding that all the places where one would typically find carriage return (ASCII 13/0x0d/^M) or line feed/new line (ASCII 10/0x0a/^J) characters, it uses vertical tab (ASCII 11/0x0b/^K) instead, presumably for the exact reason that dan04 described above for Word: to serve as a "newline" while staying within the same paragraph. good question though as i totally thought this character would be as useless as a teletype terminal today.
I believe it's still being used, not sure exactly. There might be even a key combination of it.
As English is written Left to Right, Arabic Right to Left, there are languages in world that are also written top to bottom. In that case a vertical tab might be useful same as the horizontal tab is used for English text.
I tried searching, but couldn't find anything useful yet.

How to fully justify texts programmatically (Delphi)?

How can I fully justify a block of text (like MS Word does, not only on the right and not only on the left but on both sides)?
I want to justify some texts (mainly arabic text) adjusted to certain screen size (some handheld device screen actually, and its text viewer doesn't have this function) and save this text as justified. So I can reload and reuse it again elsewhere.
(The problem with MS word is, that if you copy the justified text from MS Word and paste it to another editor it'll copy it un-justified).
Update : for now I'm thinking of doing it like this:
get-a-word
get-word-width
add-word-to-total-Word and add-Word-width-to-total-word-width
check if total-Word-width = myscreen-width then continue
else if total-Word-width is between myscree-wdith and (myscreen-width -3) then
add-spaces-To-total-word until it = myscreen-width
This is what I'm thinking now, but I put this question up and hope to see if there is a better solution, or somebody else already implemented it.
PS: I hope I have made my question clear and I'm sorry for bad expression if there is.
edit1 : changed the title to make it more clear.
If you want to justify plain text, you can only add extra spaces to the lines to get them align on the left and right. Unfortunately the character widths differ in fonts; so doing it this way will only work for a certain font, unless you limit yourself to monospaced fonts where all characters have the same size.
If you want a result like in Word, adding spaces won't cut it. Word will not add spaces, but stretch and shrink the existing spaces. This information is lost when you copy and paste it into another app.
Either way, justifying is an optimization problem. If you are interested in a good solution and its implementation: have a look a TeX. For an implementation that works on plain text with monospaced fonts have a look at par
There are some API calls that may help:
ExtTextOut and GetCharacterPlacement
Look at the GCP_JUSTIFY flag for GetCharacterPlacement
ExtTextOut is used by Canvas.TextRect
The problem you are going to face is always going to be differences in the rendering of the font. Word handles full justification by adjusting kerning as well as adjusting the number of pixels between words by a few (either way). The end result is lined up both margins. This pixel adjustment is done BOTH ways, and as evenly as possible.
To properly handle this in your portable device you will have to also perform the same algorithm for the display of the text there.
If this is not possible, then the ONLY way you can even get somewhat close would be to add whitespace between words.
As has been pointed out in other answers Word does full justification by stretching the existing spaces often by very small amounts. This is only possible if you have full control over how your text is drawn on the screen (which word - or any other windows program has).
You only real option in this regard would be to implement your own text viewer on the platform you are targeting. Eg you would need to draw the text on the screen yourself (any platform that allows games should allow you to draw on the screen). However this seems like an awful lot of trouble to get justified text.
Sorry couldn't be of more help.

Resources