LibreOffice Calc two Alignments - One Cell - format

Is it possible to write one word with left alignment and one word with right alignment in a single cell in LibreOffice Calc?
Like that: | normal Cell one | Halli _________ Hallo | normal Cell three |
Everytime I try to simulate it with many spaces between Halli and Hallo, there are format problems when I convert it to PDF.

Format the cell to have a distributed horizontal alignment [my LO 4.1.6.2 on Linux offer this option].
Stayed that way after exporting to PDF.
This is not a programming question - use SuperUser for software handling questions next time, please.

Related

Looking to find text columnar position verification tool. Does one exist?

I am working on creating text based data feed files that have fixed column widths. Example: Position 1-5 is record layout ID, position 6-35 is part number, position 36-70 is description, etc.
I wish there were a tool I could provide these data input widths, then paste in the raw text to visually see where it lines up. Conceptually, this would seem to be a pretty simple tool.
Do you know of any solutions or creative ideas?
Thanks!
Use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr
Layout Id would be str.substr(1, 5)
Part number would be str.substr(6, 35)
etc.

How to make two rows of words as big as one word in InDesign?

Im not sure how to express it so I posted a picture in link below.
It should look like this
Just enter the text on 3 lines like so:
MORE
AT
THE HALL
Then adjust the point sizes, leading, kearning, etc. to create the aesthetic you want.
In this case line 1 and 3 could have full justification.
You can use scaling of the text(as shown in the character panel in attached snapshot) because changing font size also moves the baseline and causes the text to shift downward.
These attributes are also exposed via scripting.

UTF-8 encoding and output RTF formatting in Z-Tree

I'm trying to build a Prisoner's Dilemma game in Z-Tree (the toolkit for building game theory experiments), and have encountered two irritating problems.
I haven't succeeded in applying formatting to the output inside of an item. Specifically, I'd like to display the number of years of prison each player gets at the end of a game, in the format:
Years of Prison: value
using the Layout dialogue of the Item box. Not using the layout and inserting the values directly into the text leads to a far too messy display.
Is there a way to do that using variables (conceptually, something like Payoff = {\rtf \fs30 Payoff}), and not concrete values (like !text: 1 = {\rtf \fs30 1}).
Is there a way to enable UTF-8 encoding? I have some letters (like č or š) which aren't being displayed correctly?
I'm using the latest Z-Tree version, on Linux ElementaryOS, running on Wine.
Answer to 1: In the label of your item, do this:
<>{\rtf Payoff = \fs30 <Payoff|0.1> }
Answer to 2: I do not know for sure. I think the font z-Tree uses by default does not support those characters. What I would try is to find a font that supports them and use it. In your code the characters will appear as weird symbols, but maybe in the leafs they'll be displayed correctly.

Detect text selection with SDL_ttf 2

I would like to implement a simple input box with SDL and SDL_ttf. Just like the address bar in your browser.
I'm guessing what is the easiest and most efficient way to detect a mouse selection with SDL_ttf.
Let say the box display text like this:
+--------+
| abcdef |
+--------+
The user clicks between 'c' and 'd', then it drags the mouse to the left by several pixels. Now I need to detect that it has selected the 'c' character.
The SDL_ttf library has several functions to determine the metrics of a text. You can compute the whole text size with TTF_SizeUTF8 and you can also determine a glyph size for an individual character with TTF_GlyphMetrics.
Rough idea would be to create a special array with all individual characters with their respective size just to determine their positions in the box.
Do you have better ideas on how this can be implemented easily?
Text selection in immediate rendering mode should be worked on from zero , which is alot of work to do. there is the legendary stb_textedit used by many immediate gui libraries like imgui , you can find it here
https://github.com/nothings/stb/blob/master/stb_textedit.h

Printing a graphic to a Zebra LP2844 with the GW EPL command?

I need to print an image that is being returned to me through a web service (the data is returned as RAW) and I cannot for the life of me figure out how to print a graphic to a label with EPL.
The EPL manual defines the Graphic Write instruction as:
GWp1, p2, p3, p4, DATA
All of the parameters are returned to me, so I don't have to worry about calculating the height, width, etc., but my problem is that I don't know how to format the DATA.
The manual says DATA should be
Raw binary data without graphic file formatting. Data must be in bytes.
I've tried passing a binary string and a hex string, but nothing seems to work. There is no example on how to use this command in the EPL manual and after hours of searching online I have not been able to find a single example of how to use the command (i.e. example EPL commands that I can copy & paste to send to the printer).
Does anyone have an idea of how to use this command? Could you provide me with an example? (by example I don't mean a framework, code, etc., what I mean is just the plain EPL commands).
I can confirm that the data is in raw, uncompressed binary. It is also inverted-- that is, the 0 bits print as black, at least on my UPS-firmware LP-2844. I have no idea why all the examples from Zebra show the data as encoded into a hex representation.
It's worth noting that most print servers (HP Jetdirect, Lantronix LPS1-T, and almost certainly the Zebra built-in and external print servers) will form a binary connection to the printer if you spit data at them on port 9100 (using netcat for example):
nc printer_hostname_or_ip_address 9100 < test_file.txt
You get no feedback from the printer, except for the label having printed or not.
It takes my LP-2844 (UPS Firmware) printer about 5-6 seconds to print a label containing a 816 wide x 1218 tall downloaded bitmap onto a 4" wide x 6" tall label. It seems to be all imaging time: sending three labels at once is not any faster, and the network connection (through a Lantronix LPS1-T) is held open until the final label prints. That image is at the native resolution of the printer (203 dots/inch), and there is no dithering or resizing going on (I don't think EPL2 even knows how to dither or resize).
It might be possible to speed up the imaging time by optimizing the label into many smaller bitmaps (and horizontal and vertical line segments, and perhaps filled-in rectangular blocks). This wouldn't be a very hard optimization because the image is a single-bit black and white bitmap, and the code would be fairly simple. I don't know if it would really speed it up, though.
A more modern Zebra GX420 running ZPL with a built-in ethernet port ($500 online) can print the same label (with essentially the same graphic download encoding) in 1-2 seconds.
By the way, since I haven't yet actually answered the question, the raw EPL code for this is:
(a blank line)
N
q816
Q1218,20
GW10,10,102,1218,(124236 bytes of inverted bitmap data)
P
all the newlines are 0x0a (unix-style).
Maybe this will help, it has examples (and corrects an error in the manual). Also, it may be easier to use the GM command instead and just delete the image each time (see here for a stackexhange related question).
That being said, I've never gotten my Eltrons to successfully print an image (but my jobs don't require it).
Good luck!!
EDIT: Here's another link with example Perl code. They're aiming for Chinese characters but show how to print the Great Wave image (which oddly is Japanese).
I found that it is not possible to send a graphic to a Zebra printer with EPL using ASCII characters. The data must actually be sent as RAW data. So, for example, you can't send a graphic to the printer using Zebra Setup Utilities, or through any other means that cannot write RAW data from a file directly through the printer.
The only way around this I've found is to create the label as an image and send that image to the printer via a print command within your application.

Resources