Subscript in text (Windows Forms) in C# - c#-3.0

How to display superscript in Windows Forms using C#.
Say, i need to display 5 cubic metre as
5 m3 (with 3 as superscript).

The keystroke for the '³' character is Alt+0179. Charmap is your friend. ;)

Related

How to make fontsize bigger for one letter in matlab plot title

I want to make \mu to appear the same size as the other letters, how can i do that?
title('Größen-Parameter x in dem spongiösen Knochen(300\mum, 600\mum und 2000\mum)');
To answer the question in the title:
You can adjust the font size of a letter (or a text of any length) with {\fontsize{size},letter}. E.g.:
title('Größen-Parameter x in dem spongiösen Knochen(300{\fontsize{14}\mu}m, 600{\fontsize{14}\mu}m und 2000{\fontsize{14}\mu}m)');
However, your actual problem seems to be that the mu's appear slightly smaller than the rest of the text. The reason for this is that Matlab by default interprets normal text as literal characters (WYSIWYG) while using a latex interpreter if you call a latex command such as \mu. This causes those letters to be displayed differently.
Of course you can just increase the size of those letters, but that's not very elegant and the letters will still have a different style. As an alternative I would suggest using a Latex interpreter for the whole text - aside from solving your problem, it will also look nicer!
title('Groessen-Parameter x in dem spongioesen Knochen (300 $\mu$m, 600 $\mu$m und 2000 $\mu$m)','interpreter','latex');
The only problem are your german special characters (ö and that double s thingy). To display those correctly you would have to load the german language package ngerman. This isn't easy but there are instructions here. However, if you are using a german matlab (if that's a thing) it might work without that.

Setting Letter Size in FPDF

I want to set my FPDF paper size to 8.5 X 13 that almost the same with MS Office Word paper size. Right now I' using the following codes below.
$pdf= new PDF('P','mm','A4');
How could I set my paper size the same with that?
You can also use millimeter. You just need to convert 8.5 x 13 inch into millimeter.
You can also open MS Office Word, open word options then click on advanced. Then change the measurement unit to millimeters to see the millimeter size of the paper in MS office Word then use the size in the measurement of the following paper sizes.
$pdf= new PDF('P','mm',array(215.9,279.4));
The fpdf documentation shows that you need an array() to set custom dimensions:
$pdf = new PDF('P','in',array(8.5,13))

Gnuplot--Unicode characters with postscript terminal

I want to print a per mil sign (‰) with Gnuplot. I am using postscript output terminal. I tried with 'set encoding utf8', and then call the per mil sign with {u+2030}. This does not work.
I do not have pdfcairo available as an output terminal.
Below are the available terminals on my MacBook Pro.
gnuplot> print GPVAL_TERMINALS
canvas cgm context corel dumb dxf eepic emf emtex epslatex fig hpgl latex mf mp pcl5 postscript pslatex pstex pstricks qms svg tek40xx tek410x texdraw tgif tkcanvas tpic unknown vttek x11 xlib xterm
You can obtain a "per mil" symbol with the postscript terminal using special character {\275}:
set term postscript enhanced
set output "out.ps"
set xlabel "{\275}"
plot x

itextsharp - extracts text backwards

Can't for the life of me figure out why when I extract text using iTextSharp, some of the text comes in backwards.
using (iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(#"C:\Temp\pdftest\sample.pdf"))
{
string sText = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(reader, 1, new iTextSharp.text.pdf.parser.LocationTextExtractionStrategy());
}
*Reason I using a LocationTextExtractionStragegy is because I will be using coordinates to pull the text from this position. I've just included a crop of the full PDF for my example. If I use a SimpleTextExtractionStrategy, the "B uy 5 egt 5" and " eerf" don't show up.
Output (from sample code):
B uy 5 egt 5
eerf
4x6 PRINTS Download free
CVS Mobile App.
Promo code O H m OBILe PICS
sed items available in all stores We reserve the right to
There's definitely something weird going on the with "eerf". In the pdf, the cursor goes horizontal when you try to select it (Big red FREE).
[
If I use acrobat professional, Advanced -> PDF Optimizer, select Transparency, then save the file, the text is extracted correctly and the "Red Free" is selectable.
So two questions, how can I emulate the PDF Optimizer in iTextSharp?
Or, how can iTextSharp read this text correctly?
As you can see this is my first post so don't beat me up too bad.
Additional Test:
I even extended the LocationTextExtractionStrategy and RegionTextRenderFilter so I could return the coordinates of each Textchunk. The weird thing about the "Big Red" Free, is the F's start and end points was the exact same. Same case with the R, and two E's. I would have expected that the end point was equal to the start point + the width of text.

Formatting tabular data using unicode characters

I need to produce a calculation trace file containing tabular data showing intermediate results. I am currently using a combination of the standard ascii pipe symbols (|) and dashes (-) to draw the table lines:
E.g.
Numerator | Denominator | Result
----------|-------------|-------
6 | 2 | 3
10 | 5 | 2
Are there any unicode characters that could be used to produce a more professional looking table?
(The file must be a raw text format and cannot use HTML or any other markup)
Edit: I've added an example of what the table now looks like having taken the suggestion on board and used the unicode box drawing characters:
Numerator │ Denominator │ Result
──────────┼─────────────┼───────
6 │ 2 │ 3
10 │ 5 │ 2
There are Unicode box drawing characters (look for Box Drawing under Geometrical Symbols - the chart itself is a PDF). I don't have any idea how widely supported those characters are, though.
Your table is getting help from the monospaced font triggered by the code tags here. Proportional fonts can prevent tabular alignment of the digits. Unicode has digits that retain tabular alignment regardless of fonts in the Mathematical Alphanumeric Symbols from 1D7CE-1D7FF like these 𝟶𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿
&#x1D7F6 &#x1D7F7 &#x1D7F8 &#x1D7F9 &#x1D7FA &#x1D7FB &#x1D7FC &#x1D7FD &#x1D7FE &#x1D7FF
You should look at this Javascript Box Drawing Demo. This is a JavaScript Unicode box drawing tool whose purpose is to make it easy for users to draw Unicode box art in HTML textareas. There you will see how to draw boxes using the arrow keys.
First you should select a style other than "Off".
Then using the arrow keys move around and you will see the box being drawn as you type
Once you are satisfied with the look of your drawing, simply copy it from the box and paste it on your HTML code.