Escape character for labels in Bolt CMS - yaml

When I create a field with a label in the YAML, the label is not valid when I try to add an % for example. The following code is my current try.
content_image:
fields:
image:
type: image
label: "Afbeelding 100%"
As a guess I tried to do use \% as an escape character, but that does not solve it. Reading the documentation I cannot seem to find this information, and it keeps wondering if it is possible at all.
So my question: Is there an escape character in Bolt CMS to add to labels?

For this use case I fixed it by doing:
label: "Afbeelding 100% "
As you can see, I added a space (or any other character) after the % because otherwise the system would not allow it. A label can't end with a % for some reason, and when you place a space after a % there is no need for an escape character.

Related

Using GREP to format numbers which are succeeded by specific characters

Hi dear stackoverflow community,
I have a small GREP question and would need your help.
In my catalog, there are some ordering numbers which need specific formatting.
As you can see, the numbers are always bold and they also are colored when they are preceded by a "to ".
However, I want the two numbers before the " to" to be colored also.
I was not able to find out how this is done.
This is how they SHOULD look like using GREP. Basically the "00" is also colored.
Right now, my GREP code looks like this.
(?<=\d\d)-\d\d(?=\sto)
On the right you can see that right now, the "00" in front of the "to" is not colored.
Does someone know why this is not working? :)
Apply the following three Grep patterns to the Paragraph Style:
(?<=[A-Z]{2}-)\d{4}-\d{2} - Apply Character Style: Bold (example).
(?<=[A-Z]{2}-\d{4}-)(\d{2})(?= to -??\d{2}) - Apply Character Style: Bold-Color (example).
(?<=[A-Z]{2}-\d{4}-\d{2} to )-??\d{2} - Apply Character Style: Bold-Color (example).
Note: The two different Character Styles used, namely Bold, and Bold-Color
Paragraph Style Options > GREP Style:
Result:

cc.LabelTTF: spacing between characters

Is there a way to change a space between characters? Some ttf font strings look very compressed.
The maximum closest thing I've managed to find is cc.FontDefinition
But it doesn't look like it contains anything specific I need.
As far as I know there is no method to change space between characters but you can change letters position via accessing it.
label.getLetter(index);
returns the character as a sprite. And then you can set its position.

How to force non-breaking space in reStructuredText, in code environment?

I have this snippet in my reStructuredText document:
1. Find the file at ``~/Google Drive/code/mac/install.sh``.
Notice the code/quote environment. Notice the space between Google and Drive in the path.
When rendered with Sphinx in HTML, there is a line-wrap between Google and Drive, and the space is gone. (Since this is documentation, I need everything in the code environment to appear to the user exactly as it is entered, which includes the space between 'Google' and 'Drive'. Not only should a space be present, but it should be shaded grey just like all the other code in the code environment)
How do I tell reStructuredText to use a non-breaking space in that location?
It works for me if the regular space character is replaced with a non-breaking space (U+00A0) in the reST file. That will produce a single <span> element containing Google Drive in the output:
<span class="pre">~/Google Drive/code/mac/install.sh</span>
Inserting a literal non-breaking space can be done in several ways. See https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods.
Put some css in a file _static/custom.css at top repertory in your project
code.docutils.literal {
white-space : pre;
}
(I don't know how from CSS allow breaks say at slashes but not at spaces).
For the approach you can do this:
1. Find the file in our Google Drive folder It is located at
``~/Google`` |_| ``Drive/Quisquam/code/repo/latest/application-bundles/mac/install.sh``.
.. |_| unicode:: 0x00A0
:trim:
Edit: much better than second approach is as pointed in comment to use a NO-BREAK SPACE in the reST source. Then the HTML will use , and the URL will still wrap at slashes contrarily to first approach above which makes it really unwrapping (in my brief investigation).
I had used second approach in other context (also targeting LaTeX output) to insert Unicode+202F, and it had slipped out my mind that for Unicode+00A0, one only has to use it directly in reST source.
The fix for me was to add the following css to the custom.css and make background-color match the pre background-color
tt,
code {
color: #839496;
background-color: #073642;
}

ZPL data printing at label

I have to print data from DATA_FIELD that can contain between 5 to 50 characters
and label can fit just 20 letters
due i have right to left spelling words i have to print always top 20 letters from right other wise ill loose 1st words of customer name and its usually most important because contains name of the customer
for example i have a code
^FO40,240^A#N,40,40,E:DAVIDBD.FNT
^FD%%Depositor%%
^FS
thats depositor name is:
i dont know why its so long name -- can be variable
and i have to print always last 20 letters as:
its so long name --can be variable
will be happy to get any tips or help
Regards
There really isn't much ZPL can do to help. ZPL is really a page description language, not a programming language.
You will need to process the string to the correct length before adding it to your label code. If you are not using a mono spaced font, then you will have to accommodate for the variable character width.
If you are using a monospaced font you simply have to know how many characters will fit in the area you are trying to print.
If you can wrap text, you might make use of the Use the ^FB – Field Block command in the manual

Ruby PDF::Reader matching bullet point with Regex

I have parsed a pdf document in Ruby with PDF::Reader. The bullet point of the pdf file appears in my parsed text as a strange cube with F0B7 inside like this (I also attached a print screen):
__
|F0|
|B7|
I would like to know if I can match this "bullet point" with regex and if so, what would be the appropriate way to do it? I have absolutely no idea to tackle this issue as I am not even sure that this is part of the string in the first place. Thanks.
This is a unicode symbol with codepoint F0B7.
Unfortunately your Ubuntu installation has a default font that misses that glyph, and when glyph is missing in the font definition, the common approach is to draw it’s codepoint in a square.
The regexp to match it would be:
/\uF0B7/

Resources