Hi I wrote this code for a VISIO addin to create shapes and include text in it, here is a part of the code
visioRectShape.Text = "My text";
visioRectShape.get_CellsSRC((short)Visio.VisSectionIndices.visSectionParagraph,
(short)Visio.VisRowIndices.visRowFirst, (short)Visio.VisCellIndices.visHorzAlign).FormulaU = "0";
now i want to align this text to top and to the left and format the text to make it bold inside the shape.
with the above code I am able to align it to the left but not able to make it bold or align it to the top.
Can someone please help me with this.
You can use the macro recorder to figure out what operations Visio performs to achieve the formatting you want. To do so, click "Start recording", then perform your operations (set text bold, and align to the top), click "Stop recording", and examine the source code generated by the recorder.
You should see something like this:
' bold font
shape.CellsSRC(visSectionCharacter, 0, visCharacterStyle).FormulaU = "1"
' align top
Shape.CellsSRC(visSectionObject, visRowText, visTxtBlkVerticalAlign).FormulaU = "0"
Using C#
// bold font
visioRectShape.get_CellsSRC(
(short)Visio.VisSectionIndices.visSectionCharacter,
(short)0,
(short)Visio.VisCellIndices.visCharacterStyle).FormulaU = "1";
// align top
visioRectShape.get_CellsSRC(
(short)Visio.VisSectionIndices.visSectionObject,
(short)Visio.VisRowIndices.visRowText,
(short)Visio.VisCellIndices.visTxtBlkVerticalAlign).FormulaU = "0";
Related
I'm printing an adhesive label (6x5cm) with a printer model 3nStar RPT006.
In the adhesive I am printing a title, QR code and the QR code in text
something like this
My Title
▄
qr code
Using this class as reference, I'm doing something like this:
initialize(),
setJustification(Printer.JUSTIFY_CENTER),
'My Title',
feed(),
qr(qrText),
feed(),
qrText,
feed(2),
cut(Printer.CUT_FULL, 1),
My problem is: I don't know how to control the vertical size, or how to set the height of the paper. Between each label I have a gap of 3mm.
So my question is, how should I handle the vertical spacing/height?
Currently I very close to get a perfect label, but seems like the printed label is some millimeters shorter and each time I print a label, it miss a little bit more, so there is a time where I start to cut the adhesive part and not the gap
I'm not sure if it's possible in your environment, but there are three options.
Prepare blank image data with the required number of vertical dots and print it(graphics(EscposImage $image, $size)) instead of the line feed code.
Use setLineSpacing($height) to change the height of one line only for the required part and start a new line. Then return to the original size.
Make your own customization by adding the function to feed the paper in dot units to the library for printing.
ESC J
I want to show remain text of line underneath it's upper line in UILabel. How can i do that? I used UILabel for to show this text and i set Lines = 0. Any help would be greatly appreciated.
cell.Describtionlabel.text = "Intelligient Keyboard Engine (IKE™) \n\t- When typing up IKE will give you suggestions and ideas. \nDictate \n\t- We also have audio mode which allows you to dictate your report and we type it up for you.\nSelf Transcribe\n\t- If you wish to type up yourself just select self transcribe as your delivery option."
Check for the alignment, set label alignment to left,
Check if there is any initial space when you are setting the text to your label.If yes, remove that.
This will solve your issue.
User Swift Multiline String Literals
From the Doc
Multiline String Literals
If you need a string that spans several lines, use a multiline string literal—a sequence of characters surrounded by three double quotation marks:
let quotation = """
The White Rabbit put on his spectacles. "Where shall I begin,
please your Majesty?" he asked.
"Begin at the beginning," the King said gravely, "and go on
till you come to the end; then stop."
"""
When i try to print a line of text with tabs(#9) in them, the tabs are trimmed
Text = '- Hardware:'#9#9'Virtual server'
Printer.canvas.FillText(MyRect,Text,False,1,[], TTextAlign.taLeading, TTextAlign.taLeading);
But the tabs are not printed and the text is not seperated.
Is there a function to mimic tabs?
Maybe you can add your text lines to a TMemo with memo1.lines.add and then use memo1.PaintTo to paint the formatted text to the printer canvas ? Depends if you can make do with a single font and the limited formatting of Tmemo.
Otherwise you have to work out the tab positions and draw the words individually.
I want align text to center on elm_label widget. I can't find any functions about text align as evas object text function or elm_label function. Also, I can't find a function that can get the text size (absolute pixel or relative size) on a label.
I have tried elm_object_style_set with marker, it was showed bold text on center of label, but font size was too small (smaller than default style). (and I don't want bold on text.)
How I can align text to the center of a label?
You can use HTML like markup to customize the way you want to the display the text in elm_label.
To align the text to the center, you can use <align> markup tag with value center .
std::string text = "<align = center> TEXT TO DISPLAY </align>";
Evas_Object *label = elm_label_add(parent);
elm_object_text_set(label,text.c_str());
evas_object_show(label);
You can also use other tags like font_weight, font_style to customize your display text. List of all possible tags can be found here
You can set the alignment of the label through the evas_object API. Likely what you are looking for is:
evas_object_size_hint_align_set(label, 0.5, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
The 0.5 is center, you could try 0.0 for left align and 1.0 for right.
Hi I'm using LateX. I have a block of text that I'd like to have a small box like space highlighting the are (just like a \begin{equation} but for text).
Is there such a thing in LateX?
I'm not 100% sure what you're asking I'm afraid, but if you just want to indent text with a margin on each side of the page to make it stand out, you can use...
\begin{quotation}
Quotation is good for long blocks of text that you want highlighted
\end{quotation}
\begin{quote}
Quote is suited to a single block of quoted text.
\end{quote}
If you actually want to have a physical black box around the text, you might want to consider wrapping it in a tabular / table, or you might want to delve into minipages and/or par box environments...
Is \makebox what you're looking for?
To create boxes of text that behave differently from the rest of the text, we can use
\makebox[width][pos]{text}
The width sets the width the of the box. The pos sets the positioning of the text - either r (right justified text), l (left justified), or s (stretched to fill the box). If the pos parameter is left out, as in \makebox[1in]{centerme}, the text is centered. The text is placed in the box. If you want to draw a box around the text, use \framebox just as you would use \makebox.
\mbox{text} and \fbox{text} are quick versions of \makebox and \framebox, which create a box to fit the size of the text.
There are some more examples at http://www.artofproblemsolving.com/wiki/index.php?title=LaTeX:Layout#Boxes