Author |
Message |
Argolance

Joined: 06 Jan 2008 Posts: 3822 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Mon 15 Feb 2016, 14:01 Post subject:
YAD Font selector output values [SOLVED] Subject description: Get font name/style/size separately |
|
Bonjour,
Is it possible to get the output font name, font style and font size separately using YAD font selector?
Not so hard to get the font size, more to get the style when both Italic/Bold selected and very much more when the font has such a name:
Quote: | Schadow BlkCn BT Bold Italic 10 |
Cordialement.
_________________
Puppy Search
Last edited by Argolance on Thu 18 Feb 2016, 19:11; edited 1 time in total
|
Back to top
|
|
 |
rg66

Joined: 23 Jul 2012 Posts: 1160 Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!
|
Posted: Mon 15 Feb 2016, 18:24 Post subject:
|
|
Code: | #! /bin/bash
yad --font | while read line; do
STL=`echo $line | grep -o "Bold\|Italic\|Oblique\|Condensed\|Medium"` #Might need to add more styles
STYLE=`echo $STL`
SIZE=`echo $line | awk '{print $NF}'`
if [ "$STYLE" = "" ]; then
NAME=`echo $line | awk -F"$SIZE" '{print $1}'`
else
NAME=`echo $line | awk -F"$STYLE" '{print $1}'`
fi
echo $NAME
echo $STYLE
echo $SIZE
done |
_________________ X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
X-series repo
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 3822 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Mon 15 Feb 2016, 19:05 Post subject:
|
|
Thank you!
For these lines to work properly, it is necessary to list all the available styles like 'normal', 'book', 'demi', 'roman', 'medium', 'gras', 'italique', 'regular' and who knows what else...
I already tested similar things but it is not exactly what I am looking for: I thought it might be possible to do this more "properly" using internal YAD options and simply get something like:
Quote: | Schadow BlkCn BT|Bold Italic|10 |
... regardless the font name or style complexity...
If YAD does not allow such a trick, I am very surprised and really think it should!
Cordialement.
_________________
Puppy Search
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 3822 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Wed 17 Feb 2016, 06:13 Post subject:
|
|
Bonjour,
I took the liberty of asking the question to the YAD developper and he gave the response:
Victor Ananjevsky wrote: | no, this is impossible right now.
but i think this may be usefull, so i'll add such output in next release
On Tue, 16 Feb 2016 01:21:19 -0800 (PST)
A. wrote:
> Bonjour,
> Is it possible to get the output font name, font style and font size *separately
> *using YAD font selector?
> Something like:
> Schadow BlkCn BT|Bold Italic|10
> Thanks in advance. |
https://groups.google.com/forum/#!topic/yad-common/NoJXv-9HQAg
Coming up next...
Cordialement.
_________________
Puppy Search
|
Back to top
|
|
 |
Argolance

Joined: 06 Jan 2008 Posts: 3822 Location: PORT-BRILLET (Mayenne - France)
|
Posted: Thu 18 Feb 2016, 19:09 Post subject:
|
|
Bonsoir,
Code: | # yad --version
0.33.1 (GTK+ 2.24.10)
# yad --font --separate-output
PizzaDude Bullets|Bold Italic|10
# yad --font --separate-output
Bitstream Vera Sans Mono|Bold Oblique|73
# yad --font --separate-output
Nimbus Roman No9 L|Regular Italic|10 |
YAD 0.33.1, compiled from svn running Puppy Precise 5.7.1/ToOpPy LINUX 2.0.
Cordialement.
_________________
Puppy Search
|
Back to top
|
|
 |
|