Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Jul 2019, 18:34
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
YAD Font selector output values [SOLVED]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 3619
Location: PORT-BRILLET (Mayenne - France)

PostPosted: 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?
Code:
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:
Quote:
Schadow BlkCn BT Bold Italic 10

Shocked Embarassed

Cordialement.

_________________


Last edited by Argolance on Thu 18 Feb 2016, 19:11; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
rg66


Joined: 23 Jul 2012
Posts: 1160
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

PostPosted: 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
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 3619
Location: PORT-BRILLET (Mayenne - France)

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

_________________

Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 3619
Location: PORT-BRILLET (Mayenne - France)

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

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 3619
Location: PORT-BRILLET (Mayenne - France)

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

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0740s ][ Queries: 11 (0.0221s) ][ GZIP on ]