TextMorph default font size - squeak

I'm trying to have an empty TextMorph with a default font size of 12 points, where the original default is 9pts. If I bring up the halo and change the font size to 12pts, the empty TextMorph will still default to 9pts when text is entered into it. I can sort of get around this by putting a space in the TextMorph, then changing the font via the halo to be 12pts. However, this seems rather clunky, and as such was wondering if there might be another way to accomplish this?
thanks.

Related

TCPDF MultiCell ignoring $fitcell parameter when using $ishtml=true

I have a pdf with an area for text to go. The text can sometimes be very long or quite short. TCPDF has a great feature in MultiCell called $fitcell, which adjusts the font size based on the containing cell.
However, this parameter gets ignored when I use $ishtml=true, and it doesn't change the font size, which then goes out of the cell when it gets too long.
I need it to be HTML (to change font colors and bold within the text), but also to be fitted by adjusting the size.
How can I accomplish this?
I have tried using writeHTMLcell, but it doesn't have a $fitcell param.

How to get a normalized font size for a PDF using PDFBox

I am working on a project that parses pdf files and extracts text. I am using the TextPosition class to generate a data-structure containing the position and size of each character in the pdf file.
I am running into an issue where there is a custom defined Type 3 font inside the pdf with really large characters. Font that appears to be about font size 9 on the screen are actually set to a font size of 0.24. I attempted to try and use the fontDescriptor to try and get the cap height of the font and use that instead, but it is null. Also, there is another font on the page that has a large amount of white-space above and below it, making the Cap height unusable. Here is what the TextPosition class looks like for a random character on the page.
I was hoping that someone knew how to get the correct pt font size?
Thanks

How to adjust Font Size according text viewable in a TButton.Text using Firemonkey?

I am using buttons to display product names in a matrix using TGridLayout.
The problem is that commonly Items contains 3 or 4 words and in my language (Portuguese) some words tend to be long.
I would like that somehow I could calculate the size of the font, decreasing it, in order to make all the text show up automatically (of course there is also a decrease limit, anything below 9 or 8 point for the font turn to be difficult to read).
The wordwrap property is turned on to have many lines, and use the most possible space for the text.
I don't know if you're programming for an Android/iOS app, but you can't change the fontsize of a button. I've had the same problem, my solution was to make an abbreviation of the words. And then i put labels above it to explain the abbreviations.
Of course you can adjust the font size of a button:
TButton.TextSettings.Font.Size

Word Openxml: how to get a text box the right size?

I'm using PHP to generate docx documents from a database. The generated document contains column charts which have labels attached (i.e. user shapes containing textboxes). In an attempt to get the textboxes to accommodate and display all of the text (i.e. it shouldn't be necessary for the user to resize a textbox to see all the text) my code calculates how many characters will fit into 3cm, adds linefeeds to the string as required and tells me how many lines of text are needed. I have:
<a:xfrm xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
<a:off x="1638276" y="1676399"/>
<a:ext cx="1257325" cy="'.(252000 * $labelLeftLines).'"/>
</a:xfrm>
which I believe should give me a text box around 3.5cm wide (extra .5 for the internal padding) and a height of .7cm multiplied by whatever is the value of $labelLeftLines. However, the text box always turns up as 3.cm wide by .86cm high, which only ever displays one line of text.
If I add in 'autofit':
<a:bodyPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" vertOverflow="clip" wrap="square" rtlCol="0">
<a:spAutoFit/>
</a:bodyPr>
the generated file looks just the same, though, when I right click on the textbox to inspect the properties, 'autofit' is indeed applied. I have to uncheck it and recheck it to make it affect the textbox.
Any openXML gurus out there?
Hmm, some random floundering around revealed that the values I need to manipulate are here:
<cdr:relSizeAnchor xmlns:cdr="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing">
<cdr:from>
<cdr:x>0.47</cdr:x>
<cdr:y>0.75</cdr:y>
</cdr:from>
<cdr:to>
<cdr:x>0.67</cdr:x>
<cdr:y>1</cdr:y>
</cdr:to>
Changing those values does actually change the size of the texbox, though I haven't a clue what units are being used. From 0.75 to 1 produces a height of 1.43cm.
One day I'll maybe be able to find my way around the doucmentation.

What is the optimal icon size for XPages Mobile Control line items in views?

I have been adding icons to my mobile control Line Item controls and haven't quite figured out what the preferred size of these icons should be. The CSS has max size settings of 35 by 35px.
The reason I ask this is because the icons don't seem to line up correctly. The CSS positions them at 0 0. If all else fails I may modify CSS and position them to something other than 0 0.
Still interested in hearing how you have dealt with this.
In the teamroom template, the mobile view for Recent Activity has icons that line up with the text. All these images are 16 X 16px.
There will never be 1 fit for all, the layout will be dependant on font size, row height and where you want it to line up. Some people may want it to align in the middle vertically and others will want it to align with the title in the row.
I would say 21px x 21px. but that depends on what font-size you are using.
Icon size can depends upon the applicaton. Normal size is 32x32 and an extended icon size is 64x64. If you want to line up the icons, you might have to change the icons to a standard size.

Resources