Concatenate Strings to a Vector of Strings - julia

I have a string vector
faces = ["bold", "ital", "code"]
3-element Vector{String}:
"bold"
"ital"
"code"
and I have a scalar String
"The font face is "
that I want to combine to a Vector{String}
["The font face is bold", "The font face is ital", "The font face is code"]
I could swear I did this before using $faces, but I can't remember how.
Additional clarification:
I am looking for a way to insert the elements of the vector into the string. So, while "The font face is " .* faces works for this example I am looking (also) for the solution that puts the vector values inside the string. A solution that would work like
String.("The font face is $(faces)")

From the last line of your question, may be you had a patttern like this in mind:
julia> string.("The font face is ", faces)
3-element Vector{String}:
"The font face is bold"
"The font face is ital"
"The font face is code"
Semantically, this and the .* solution and the map solution are ultimately doing the same thing, but perhaps you have a preference for this syntax.

faces = ["bold", "ital", "code"]
str = "The font face is "
map(x -> str*x, faces)

List comprehension is an option as well:
["The font face is $f" for f ∈ faces]
This answer is from Nils Gudat in the comments above. (Happy to remove it if he wants to post it.)

Related

Forcing "ct" ligature for Google Web Fonts

I'm using the font IM Fell English for my project: https://fonts.google.com/specimen/IM+Fell+English?selection.family=IM+Fell+English
It has support for the "long s" ſ, and other common ligatures such as "ff", "fi", "ft", etc.
However, I can't seem to get "ct" ligature working, albeit you can see that the font does have the glyph: here 1) https://www.fontsquirrel.com/fonts/im-fell-english-pro and here 2) https://iginomarini.com/fell/the-revival-fonts/
I have tried font-variant-ligatures CSS property as directed here, but it does not work regardless of which value I set: https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures
My current compromise is to replace the "s" with "ſ" Unicode character, but as far as I know, there is no such Unicode character for the "ct" ligature (nor a joiner glyph) (as far as I could find!)
Additionally, to get the long ſ to work, I had to #import the font in such way:
#import url('https://fonts.googleapis.com/css?family=IM+Fell+English:400,400i&subset=all&text=+!%22%23$%25%26()*%2B,-.%2F0123456789:;%3C%3D%3E%3F#ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5Dabcdefghijklmnopqrstuvwxyz%7B%7D%C2%A2%C2%A3%C2%A5%C2%A9%C2%AE%C3%97%C3%B7%C5%BF%E2%80%98%E2%80%99%E2%80%9C%E2%80%9D%E2%82%AC');
The method which I obtained the value for the text parameter was that I inputted the long ſ into the preview field on the Google Font webpage for IM Fell English (the first link above), and then I watch which request my browser sent out and copied it.
As you can see below, I am much in need of re-creating this! (Notice the "ct" in "Octaves"; I've taken care of the long ſ in the titles, but not the paragraphs)
Recreation:
Original Source:
Edit: I've found a workaround.
I downloaded the IM Fell English font, then use Character Map (which is available under Windows 10), and search for the glyph and copied it (U+E004 Private Use). The trouble now is that I cannot search (using Ctrl F) for anything that contains the ligature! So, I cannot search for "Octaves" because it is now "Oaves".
I believe the original question in the title still stands. I don't want a workaround, I want to have the browser force the ligature, if that's possible.

writing single-storey ɑ in Gnuplot graph title?

How can I write single-storey ɑ (The first letter in English) in Gnuplot graph title?
I am always get "a" (double-story) in Gnuplot plot title?
Suggesting to use the Greek letter alpha "ɑ" is not a good solution.
The correct answer is that the shape of the "a" glyph is dependent on the font, not the encoding. Unicode codepoints only specify what character is to be drawn, not what shape it has.
It depends on the terminal you want to use, but probably the most straightforward solution would be to use proper encoding and paste the required character directly:
set encoding utf8
set term wxt font "Times,12"
set title 'ɑ'
plot x
EDIT:
the special character ɑ can be also specified (for example in the interactive Gnuplot console) in terms of its UTF8 representation (two octal numbers) as:
set title '\311\221'
I only use lubunutu and do not use ubunutu.
In lubuntu CharacterMap utility exists and it can be used from accessory category.
On ubuntu, the same tool exists.
https://help.ubuntu.com/community/CharacterMap
I could copy and paste Lattin Small Letter alpha "ɑ" to terminal.
(Note that is not literally single-storey version of a).
As Ethan wrote use of Lattin Small Letter alpha "ɑ" is not correct in literal sense but I think this is possible workaround.
Correct solution is use font with single-storey a like Futura font.
Free Futura font seem to be available from
http://www.webpagepublicity.com/free-fonts-f4.html#Free%20Fonts

how to put y axis greek letters in Veusz plot?

I want to put Capitalomega with index DE and k label:
and then ı want to show on the y axis label? How to do them?
Generally you can use tex symbols in Veusz. Therefore, you can write \Omega_{DE} and \Omega_{k} for your request. See details here (Sec. 2.4 Text).
Veusz understands a limited set of LaTeX-like formatting for text. There are some differences (for example, "10^23" puts the 2 and 3 into superscript), but it is fairly similar. You should also leave out the dollar signs. Veusz supports superscripts ("^"), subscripts ("_"), brackets for grouping attributes are "{" and "}".
Supported LaTeX symbols include: \AA, \Alpha, \Beta, \Chi, \Delta, \Epsilon, \Eta, \Gamma, \Iota, \Kappa, \Lambda, \Mu, \Nu, \Omega, \Omicron, \Phi, \Pi, \Psi, \Rho, \Sigma, \Tau, \Theta, \Upsilon, \Xi, \Zeta, \alpha, \approx, \ast, \asymp, \beta, \bowtie, \bullet, \cap, \chi, \circ, \cup, \dagger, \dashv, \ddagger, \deg, \delta, \diamond, \divide, \doteq, \downarrow, \epsilon, \equiv, \eta, \gamma, \ge, \gg, \in, \infty, \int, \iota, \kappa, \lambda, \le, \leftarrow, \lhd, \ll, \models, \mp, \mu, \neq, \ni, \nu, \odot, \omega, \omicron, \ominus, \oplus, \oslash, \otimes, \parallel, \perp, \phi, \pi, \pm, \prec, \preceq, \propto, \psi, \rhd, \rho, \rightarrow, \sigma, \sim, \simeq, \sqrt, \sqsubset, \sqsubseteq, \sqsupset, \sqsupseteq, \star, \stigma, \subset, \subseteq, \succ, \succeq, \supset, \supseteq, \tau, \theta, \times, \umid, \unlhd, \unrhd, \uparrow, \uplus, \upsilon, \vdash, \vee, \wedge, \xi, \zeta. Please request additional characters if they are required (and exist in the unicode character set). Special symbols can be included directly from a character map.
Other LaTeX commands are supported. "\" breaks a line. This can be used for simple tables. For example "{a\b} {c\d}" shows "a c" over "b d". The command "\frac{a}{b}" shows a vertical fraction a/b.
Also supported are commands to change font. The command "\font{name}{text}" changes the font text is written in to name. This may be useful if a symbol is missing from the current font, e.g. "\font{symbol}{g}" should produce a gamma. You can increase, decrease, or set the size of the font with "\size{+2}{text}", "\size{-2}{text}", or "\size{20}{text}". Numbers are in points.
Various font attributes can be changed: for example, "\italic{some italic text}" (or use "\textit" or "\emph"), "\bold{some bold text}" (or use "\textbf") and "\underline{some underlined text}".
Example text could include "Area / \pi (10^{-23} cm^{-2})", or "\pi\bold{g}".
Veusz plots these symbols with Qt's unicode support. You can also include special characters directly, by copying and pasting from a character map application. If your current font does not contain these symbols then you may get a box character.
In addition to the answer OmG posted, you can also directly enter the character (via a character map application or copy and paste), as Veusz supports unicode characters.

Adding glyphs to Fontforge

When I open Fontforge to create a new font, it only lists a limited set of characters / glyphs. In the font I create, I need some glyphs that are missing from that default set, e.g. "single right-pointing angle quotation mark" (U+203A) and "single left-pointing angle quotation mark" (U+2039).
How can I add "slots" for these glyphs, or rather:
What is the proper way to add glyphs that are defined in the Unicode table?
Ah, well, just go to Encoding > Add encoding slot, then there will be a dialog to set how many slot(s) you want to add.
Ah, well, just go to Encoding > Reencode and choose an encoding that contains the relevant slots.

Fontforge Scripting how to add ligatures for a glyph

I'm making a font with scripting on Fontforge. Everything goes well, but I have this problem I don't know how to specify for a selected glyph that if two other glyphs came simultaneously show the selected glyph. I have already made the Lookuptable and the subtable for that but I don't know the function that would define some ligatures for a specified glyph. Here is the code for making table and subtable for adding ligatures to a glyph.
AddLookup("Ligatures","GSUB_ligature",9,[["rlig",[["arab",["dflt"]]]]])
AddLookupSubtable("Ligatures","Ligatureshi")
You need to specify the Ligature substitution using a tuple of existing Glyph names.
A contrived example:
#!/usr/bin/env python3
import fontforge
# load your font, etc…
ligature_name = 'f_l'
ligature_tuple = ('f', 'l')
font.addLookup('ligatures','gsub_ligature', (),[['rlig',[['arab',['dflt']]]]])
font.addLookupSubtable('ligatures', 'ligatureshi')
glyph = font.createChar(-1, ligature_name)
glyph.addPosSub('ligatureshi', ligature_tuple)
After you've added the lookup & subtable, do this:
Select("fl")
AddPosSub("LigatureSubtableName", "f l")
The above FontForge script will add a fl ligature.

Resources