YAD Font selector output values [SOLVED]

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

YAD Font selector output values [SOLVED]

#1 Post by Argolance »

Bonjour,
Is it possible to get the output font name, font style and font size separately using YAD font selector?

Code: Select all

yad --font
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:
Schadow BlkCn BT Bold Italic 10
:shock: :oops:

Cordialement.
Last edited by Argolance on Thu 18 Feb 2016, 23:11, edited 1 time in total.

User avatar
rg66
Posts: 1158
Joined: Mon 23 Jul 2012, 05:53
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

#2 Post by rg66 »

Code: Select all

#! /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
[url=http://smokey01.com/rg66/]X-series repo[/url]

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#3 Post by Argolance »

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:
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.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#4 Post by Argolance »

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 ... oJXv-9HQAg

Coming up next... 8)

Cordialement.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#5 Post by Argolance »

Bonsoir,

Code: Select all

# 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 :arrow: svn running Puppy Precise 5.7.1/ToOpPy LINUX 2.0.

Cordialement.

Post Reply