There's any font that doesn't change text len - vb.net

I need a font that have the same len no matter if the line contains all 1111 or 8888.
Now I'm using the default VB.NET 2010 font and two lines with the same amount of characters have different len.

Any monospace font will do: https://en.wikipedia.org/wiki/Monospaced_font
I personally use Consolas because that is also the default font family used by Visual Studio in the code editor: https://en.wikipedia.org/wiki/Consolas
The easiest way to set the font is via the form's designer: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.font

Related

Font issue with TM symbol in SSRS reports

I have the following code that works correctly, but I need to adjust the font properly.
=IIF(IsNothing(Fields!new_trademarkname.Value),"",Fields!new_trademarkname.Value & ChrW(8482))
The issue is if I use my font "Architecht's Daughter", the ™ symbol does not appear as superscript (small.) If I use Bookman or other ordinary font, this is ok.
Is there a way to rework the formula to have ChrW(8482)) coded with a seperate font? Like the following:
=IIF(IsNothing(Fields!new_trademarkname.Value),"",Fields!new_trademarkname.Value & <font = "arial"> ChrW(8482))
'''
Use another placeholder in the same textbox for your superscript and adjust the font in the toolbox/properties (F4) window:
placeholder1 with your font "Architecht's Daughter":
=IIF(IsNothing(Fields!new_trademarkname.Value),"",Fields!new_trademarkname.Value)
placeholder2 with a regular font:
=IIF(IsNothing(Fields!new_trademarkname.Value),"",ChrW(8482))

VBA to change Visio font style by font name instead of font index?

I'm hoping to use VBA to change the font style of the texts in shapes(from Calibri to Verdana). Currently I have (a snippet of the code)
Visio.ActivePage.Shapes(1).Characters.CharProps(visCharacterFont) = 235#
235 is the font index for Verdana in my system. However, the font index is very unstable and can change on different computers. Is there a way to change the font style by font name instead, e.g. ...="Verdana"? It's possible in excel, but I couldn't find similar syntax in Visio. Thanks in advance!
You can check what is ID for Verdana font on current PC
Dim Verdana_ID As Integer
Verdana_ID = ActiveDocument.Fonts.Item("Verdana").ID
And after this step set this ID as character's font
Visio.ActivePage.Shapes(1).Characters.CharProps(visCharacterFont) = Verdana_ID

Set PPT Font to 'Body' Type

I am not able to paste the entirety of my code, but the crux is that I have a textbox in PPT 2013, myTb, that I have (programmatically) pasted some text into. I now want to perform the following two actions:
See if the original text was the PPT 'body default' font (e.g. 'Calibri (body)' vs. 'Calibri' in the MS Ribbon)
If it was the body default, set the new text to also be the body default.
I can't seem to figure either part out, even though I have experimented with reading/writing from/to most of the Shape.TextFrame[n].TextRange.Font.Name... fields. I also had two confounding points to ask about, regarding the Shape.TextFrame.TextRange.Font.NameComplexScript field:
This field does not seem to be a 'complete' indicator of body-default vs non-body-default font. The reason is that if this textbox is originally the body-default ('Calibri (body)'), it will read '+mn-cs', but then I can change the font to the non-default variant ('Calibri'), and it still reads '+mn-cs'.
I then proceed to change the textbox to an entirely different font, which changes this field to the font's name as expected. However, if I then change back to the body-default font (or any other font, for that matter), this field remains on the previous font's name.
To set the font to the body or heading font, you need to use a weird bit of syntax:
{object}.Font.Name = "+" + FontType + "-" + FontLang
Where:
FontType is "mj" or "mn" for Major (headings) or Minor (body) respectively.
FontLang is "lt", "cs" or "ea" for Latin, Complex Scripts or East Asian
For example to set the font to the theme's body text font for Latin text:
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Font.Name = "+mn-lt"
A bit late to the party, but I found this in case anyone needs it.
Edit: This is C# code, using the Interop PowerPoint namespace.
string headingsThemeFont = Globals.ThisAddIn.Application.ActivePresentation.SlideMaster.Theme.ThemeFontScheme.MajorFont.Item(MsoFontLanguageIndex.msoThemeLatin).Name;
string bodyThemeFont = Globals.ThisAddIn.Application.ActivePresentation.SlideMaster.Theme.ThemeFontScheme.MinorFont.Item(MsoFontLanguageIndex.msoThemeLatin).Name;

How can I convert excel to PDF by Libreoffice and keep all format from excel file?

Currently, I can covert from excel to pdf by command line, but I have problem about front after convert. In excel file I used Times new roman font, but after convert to pdf I found the font in PDF file is different with it. Please help me how can I fix this problem.
P/s: My excel file in Japanese language, and I'm using Libreoffice 5.0 and centos 7
As said in the comments already "Times New Roman" font has not any Japanese glyphs. So Excel will using glyphs from supplement fonts "Yu Gothic" or "Meiryo" or "Arial Unicode MS" depending of the Windows System. So you possibly will see "Times New Roman" as font in Excel's GUI but the glyphs cannot be from that font.
First of all the system which shall create a PDF from the Excel file must have a font containing appropriate Japanese glyphs. The system is in your case the CentOS Linux Distribution. So at first do # yum groupinstall "Japanese Support" as described in How to Install Asian Fonts on Red Hat & CentOS Linux Distributions.
And while converting using Libreoffice the supplement font used for Japanese characters will also be dependent on Libreoffice option settings. As far as I know there is not a directly possibility to set the font used. But dependent on the settings in
Tools - Options - Language Settings - Language - Default Language for Documents - [x] Asian: ...
different supplement fonts will be used.
For me for example, using Libreoffice 5.1.4.2 on Ubuntu Linux,
while "Chinese (simplified)" is set the font "Noto Sans CJK SC Regular" will be used,
but while "Japanese" is set the font "TakaoPGothic" will be used.
This settings also are influencing the command line
axel#arichter:~$ soffice --headless --convert-to pdf JapaneseExcel.xlsx
if not set "[ ] For the current document only".
So you could try different settings there.
To set the above options without GUI you must edit the file
/home/<user name>/.config/libreoffice/4/user/registrymodifications.xcu
where <user name> is the name of the user which then will run the soffice command line.
In this file find the line:
<item oor:path="/org.openoffice.Office.Common/I18N/CJK"><prop oor:name="AsianTypography" oor:op="fuse"><value>true</value></prop></item>
There the value must be set true. This will set the check-box [x] Asian.
Now find the line:
<item oor:path="/org.openoffice.Office.Linguistic/General"><prop oor:name="DefaultLocale_CJK" oor:op="fuse"><value>ja-JP</value></prop></item>
The value ja-JP there sets the locale Japanese.
Now save the file /home/<user name>/.config/libreoffice/4/user/registrymodifications.xcu.
Supplement:
As far as I see from your screen-shots, there are only Japanese characters in the whole sheet. So why using "Times New Roman" font at all? Why not using font "Yu Gothic" or "Meiryo" or "MS Mincho" for all cells? If so, this font setting will be stored in Excel's cell style settings and maybe then Libreoffice will using a font which is more similar to those. This I would try next if my first suggestion does not lead to a satisfying result.

The arabic letter not displaying correctly using aero report in openerp v7

I'm making a new report in openerp v7, from OpenOffice using aero report.
when i choose pdf as output, the report not displaying arabic letter correctly
if i choose odt they displaying correctly
My problem is , how can i displaying arabic letter correctly, using aero report, Thank in advance!
You issue is font setting. Please correct below settings:
Set NLS_LANG=ARABIC_EGYPT.AR8MSWIN1256 (or AR8ISO8859P6 on UNIX).
Set REPORTS_PATH to the font directory in which the TrueType font exists. For example, C:\WINNT\fonts.
Open the uifont.ali file and edit the [PDF:Subset] section to specify the TrueType font name.
[PDF:Subset]
"Andale Duospace WT J" = "Aduoj.ttf"
"Albany WT J"="AlbanWTJ.ttf"
Also for reference please use the below documentation:
Using PDF in Oracle Reports