Inno Setup change CreateOutputMsgMemoPage font - inno-setup

Is it possible to change the font that the actual message part of the window created using CreateOutputMsgMemoPage displays in?
I need to return some results from a database query to a window in Inno Setup, which I am doing by reading in from a file using:
LoadStringFromFile(ExpandConstant('{app}\Output.txt'), astrResults);
and then creating the page like so:
ResultsPage := CreateOutputMsgMemoPage(wpInstalling,
'Results', 'The following results were returned from the database.',
'',
astrResults);
The trouble is that I am losing the columnar tab delimited formatting from the text file as the text is being displayed in a variable width font. Therefore, I need to used a fixed width font (e.g. Lucida Console) to maintain the correct formatting. Is there a way to do this?

It is possible to use:
ResultsPage.RichEditViewer.Font.Name := 'Lucida Console';
to change the font and:
ResultsPage.RichEditViewer.Font.Size := 9;
to change the size. Thank you #TLama.

Related

How to make a text margin in Scintilla?

I'm currently making a class wrapper in AutoHotkey for Scintilla (currently v5.0.1). I'm not sure what issue I'm having trying to make a text margin. It seems it should be incredibly simple. I'm just asking for help with order of operations using Scintilla (not for AHK help).
I'm trying to perform the following:
ctl := g.AddScintilla("vMyScintilla w500 h500")
m1 := ctl.Margin ; isolate Margin object from control (used internally)
m1.ID := 1 ; selecting margin ID (used internally by the class)
m1.Width := 100 ; setting margin width (SCI_SETMARGINWIDTHN)
m1.Type := 4 ; set margin type 4, text margin (SCI_SETMARGINTYPEN)
m1.Text(1,"asdf") ; SCI_MARGINSETTEXT (insert text to line 1)
msgbox m1.Text(1) ; try to get text from margin line 1 ... "asdf"
I see the margin extend itself to 100px as specified in the code (hard to miss). I left everything as 0-based, so margin 1 is the symbol margin after the number margin.
The msgbox at the end shows the text i put in the margin, so it appears to succeed, but the text is not displaying.
I have tried adding a style to the text with SCI_MARGINSETSTYLE, but it has had no effect. I've even changed my windows theme to make sure the text didn't happen to be the same color as the margin background, but that doesn't seem to be the case.
I get no errors from the AHK script.
I can't figure out what I'm missing. I've made it through over 50% of the Scintilla docs with no issues, but I'm stumped.
It was laughably simple.
I was testing on a single line document. And I set my "test line" to 1, instead of 0 (because it's 0-based).

Why does changing text in Actionscript only preserve included letters?

I am working with Actionscript 3 in Flash, and I have a dynamic text field, instance called "textField" inside an instance of movie clip "mcpoo" and a keyframe with actionscript:
addEventListener(Event.ENTER_FRAME, myfunc);
function myfunc(e:Event):void{
mcpoo.textField.text = "this is a test string";
}
When I set the text field to a default value via text tool, e.g., "asdf" and test the movie, the text will change to include ONLY the chars in the default value, stripping out the rest. "this is a test string" is displayed as "ssass".
Why the good gawddam would it do something like this? As a corollary, how can I work around this or avoid it?
You need to embed more characters in the font you are using. By default, Flash will only embed the characters that you put in the field at author time. It does this to reduce file size.
Select the textfield and hit the Embed button in the Properties panel.
From there you can select the range of characters you want to include (under Character Ranges). You probably want to limit it to only the characters you will need, as it will add to the file size of the SWF.
Alternately, you could use a system font and forget about embedding anything.

How to create own bitmap font wiht image on LWUIT?

I use that code
Font bmpfont=Font.createBitmapFont(icon, new int[0], new int[12], "S");
First param is image, second is offset, third is length and fourth is charset. And I get Font object from that code. But I set that font to TextArea...
TextArea ta=new TextArea();
ta.getStlye().setFont(bmpfont);
ta.setText("S");
Text Area display only "S". Then I want to know how to create my own bitmap font and how to add that font to use. I want to make many bitmap fonts.
Generally we expect you to use the bitmap font creation tools within LWUIT and not invoke this method which is intended for internal use.
Regardless its plainly obvious you used the method incorrectly since the cut offsets don't contain the locations within the font.
Just use the resource editor or Ant task to create a font and then set that font either via the theme or by manually extracting it from the resource file.

MailMerge: No fixed width font?

I am trying to send data to a specific MergeField. The data are sent correctly. Each line of the data has for specific characters. For example the data to the field may be:
12345 FIRST\nABCDE.F SECOND
(it cannot get the newline so i just so it through character \n)
Now in the printed document each character has its one width, '1' is smaller than 'E' for example. So the data are not alligned within the field. I tried the following fonts: Arial, Tahoma, Courier New. Nothing helped.
Any ideas? Thanks in advance.
Ps the data are sent through an executable built by Visual C++ 5.0!!
You should probably use a tab-stop based layout. Set your tab-stops every, say, centimetre or so (i.e. just big than the widest character in your font) and add a tab before each element that needs to be aligned.
With this you shouldn't need to find a fixed width font and can use something more attractive.
Edit: Out of interest, I wonder why you have no luck with Courier New which is fixed width.
Maybe you could post a screenshot somewhere so we can have a look at your problem in more detail.
Try Courier - it does not have kerning (kerning = variable character width)
Also in the Font window there is a check box that allows you to apply kerning to fonts of a certain size or above - setting this value to a large font size may remove kerning.

Centering fonts in VB6

How do you determine the length of a string of text in Arial Bold font, and then center it in VB6?
We are not using a "label" or "picture box" to print the text to the screen. We are sizing the text on the fly, and allowing the user to scale the size of our application to their liking. We write the text to screen using code.
One way is to have a hidden picture box and setup the font specs of that picture box the way you want.
Then use the TextHeight and TextWidth methods of the PictureBox to take your measurements. The Units will be in whatever scalemode the Picture Box is set to.
If you are printing directly to the printer or form then just set your font FIRST then take your measurements.
To center it
MyText = "Hello World"
<displayarea>.FontName = "Arial"
<displayarea>.FontSize = 14
<displayarea>.FontBold = True
TextWidth = <displayarea>.TextWidth(MyText)
TextLeftCoordinate = <displayarea>.ScaleLeft+<displayarea>.ScaleWidth/2-TextWidth/2
<displayarea>.CurrentX = TextLeftCoordinate
<displayarea>.Print MyText
Substitute displayarea with whatever object you are using.
Based on your updated answer note that the hidden picture box suggestion isn't used to print. It is only get text measurement. However you are printing directly to the form so you just need to use the code example above.
I can't remember the specifics (it's been about 3 years since I last used VB 6), but there's a method on Form called something like "MeasureString". It takes the string, and measures it according to the font settings of the form.
Also, here's a comment posted by Jason Lepack in case I've misunderstood and over-complicated your requirements:
"Labels usually have an alignment property. If you set it to align to center then, regardless of the font face it should center in the label".
There are Win32 GDI functions you can invoke: see for example GetTextExtentPoint32 at http://msdn.microsoft.com/en-us/library/ms534223(VS.85).aspx
Your best option may be Form.TextWidth, which appears to return the width of a string in twips. I've just taken this approach in order to dynamically size a button based on the length of the label that needs to appear inside it.
There is also a corresponding function called Form.TextHeight which would allow you to do the same thing in the vertical dimension.
Make sure that you set the Font property of the form to match the Font property of the control you're intending to measure the text for, otherwise you'll get incorrect results.
Read more at http://msdn.microsoft.com/en-us/library/aa267168(VS.60).aspx

Resources