About YAD Font selector

729 views
Skip to first unread message

Ananda

unread,
Feb 16, 2016, 4:21:19 AM2/16/16
to yad-common
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.

Paul

unread,
Feb 16, 2016, 8:14:07 AM2/16/16
to yad-common
Hi,

what about to use yad --font and pipe it to sed:

 yad --font |  sed 's/ /|/g'

Paul.

Julio C. Neves

unread,
Feb 16, 2016, 12:40:18 PM2/16/16
to yad-c...@googlegroups.com
Hi Paul,
I really don't know if this is the better way, but...

Font="Schadow BlkCn BT|Bold Italic|10"
Name=
for Part in $Font
do
   Name+="$Part"
   Reg=$(fc-list | grep -iF "$Name:") && break
   Name+=' '
done
Font=${Font/$Name /$Name|}
Font=$(rev <<< $Font | sed 's/ /|/' | rev)

Abcs,
Julio
@juliobash

P
róximos cursos de Shell
Cidade         Local Período
Rio de Janeiro EDX 05-06/03 e 12-13/03 (Sábados e Domingos)
São Paulo 4Linux 11/04 a 15/04
Dou treinamento de Shell em qualquer cidade.
Para mais detalhes, me mande um e-mail.


--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ananda

unread,
Feb 16, 2016, 1:47:14 PM2/16/16
to yad-common
Thank you guys.
The command line:

yad --font |  sed 's/ /|/g'
gives:

Schadow|BlkCn|BT|Bold|Italic|10
It replaces all spaces with | and it is not what I want.
These lines:

Font="Schadow BlkCn BT|Bold Italic|10"
Name=
for Part in $Font
do
   Name+="$Part"
   Reg=$(fc-list | grep -iF "$Name:") && break
   Name+=' '
done
Font=${Font/$Name /$Name|}
Font=$(rev <<< $Font | sed 's/ /|/' | rev)
gives:

Schadow|BlkCn BT|Bold|Italic|10
Font name is cut with | and both style values too.
I am expecting for a result that gives the whole font name, the whole font style and the size for these value, separated with a character (here it is | but it could be another one) to be manipulated and converted for example this way:
<Font>Schadow BlkCn BT-10:Bold:Italic</Font>
inside an jwm xml configuration file.
For this I need:

Schadow BlkCn BT|Bold Italic|10
Regards.

Julio C. Neves

unread,
Feb 16, 2016, 2:09:36 PM2/16/16
to yad-c...@googlegroups.com
I don't know this font name, nor it is installed in my computer, so I ask to you to send the output of this command:

$ fc-list | grep -iF Schadow

Abcs,
Julio
@juliobash

P
róximos cursos de Shell
Cidade         Local Período
Rio de Janeiro EDX 05-06/03 e 12-13/03 (Sábados e Domingos)
São Paulo 4Linux 11/04 a 15/04
Dou treinamento de Shell em qualquer cidade.
Para mais detalhes, me mande um e-mail.


--

Ananda

unread,
Feb 16, 2016, 7:28:35 PM2/16/16
to yad-common
Hello Julio,

 #fc-list | grep -iF Schadow
Schadow BlkCn BT,Schadow:style=Black

I didn't choose this font intentionally. I notice that I have two fonts with similar name: Schadow BlkCn BT and Schadow. This may be the reason why even while changing the variable (which seems to be wrong?):


Font="Schadow BlkCn BT|Bold Italic|10"

to:

Font="Schadow BlkCn BT Bold Italic 10" (without | between fontname and fontstyle, and between fontstyle and fontsize)
it gives something strange.
All the same with fonts like 'Raleigh DmBd BT 10', 'Seagull Hv BT Bold Italic 10' and so on. These fonts are on my PC but I really don't know where they come from...

Font=`yad --font --fontname="Bitstream Vera Sans Mono Bold Oblique 12"` # does not work:

Name=
for Part in $Font
do
   Name+="$Part"
   Reg=$(fc-list | grep -iF "$Name:") && break
   Name+=' '
done
Font=${Font/$Name /$Name|}
Font=$(rev <<< $Font | sed 's/ /|/' | rev)
echo $Font | sed 's/^/Fontname=/;s/|/\nFontstyle=/;s/|/\nFontsize=/' > /tmp/test
echo $Font | sed '/Fontstyle/s/ /\nFontstyle_=/' /tmp/test

gives:

Fontname=Bitstream Vera Sans
Fontstyle=Mono
Fontstyle_=Bold Oblique
Fontsize=12

Font=`yad --font --fontname="Bitstream Vera Sans Bold Oblique 12"` # works and gives:
...
Fontname=Bitstream Vera Serif
Fontstyle=Bold
Fontstyle_=Oblique
Fontsize=12

Font=`yad --font --fontname="Bitstream Vera Serif Bold Oblique 12"` # works and gives:
...
Fontname=Bitstream Vera Sans
Fontstyle=Bold
Fontstyle_=Oblique
Fontsize=12

All works fine with many other normal/standard fonts I tested.

Best regards.

Victor Ananjevsky

unread,
Feb 17, 2016, 12:51:45 AM2/17/16
to yad-c...@googlegroups.com
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)
Ananda <anand...@gmail.com> 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.
>
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Victor Ananjevsky <anan...@gmail.com>

Ananda

unread,
Feb 17, 2016, 5:01:33 AM2/17/16
to yad-common
Great!
Thanks to all...
Have a good day.

Cordialement.

ToOpPy LINUX

Ananda

unread,
Feb 17, 2016, 10:50:55 AM2/17/16
to yad-common
Hello,
Just for fun rg66 sent this:
#! /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

Cordialement.

Victor Ananjevsky

unread,
Feb 18, 2016, 2:25:09 PM2/18/16
to yad-c...@googlegroups.com
added in svn

В Wed, 17 Feb 2016 02:01:33 -0800 (PST)
Ananda <anand...@gmail.com> писал:
> ToOpPy LINUX <http://tooppy.linux.free.fr/index.htm>

Ananda

unread,
Feb 23, 2016, 5:29:44 AM2/23/16
to yad-common
Tested OK!
Thanks.

Ananda

unread,
Mar 19, 2016, 7:59:25 AM3/19/16
to yad-common
Hello Victor,
... Unfortunately, I noticed this little issue:

# yad --font
Brush Script MT Italic 10
# yad --font --separate-output
Brush Script MT|Italique|10
# yad --font --separate-output --fontname="Brush Script MT
Italic 10"
Brush Script MT|Italique|10
#  yad --font --separate-output --fontname="Brush Script MT Italique 10"
Sans|Regular|10
#

Output style value in (for my case) French (Italique, instead of Italic) will not let the selector have the focus on the input font but on the default one (Sans...)

Cordialement.

Victor Ananjevsky

unread,
Mar 19, 2016, 10:12:37 AM3/19/16
to yad-c...@googlegroups.com
sorry, but i don't make any translations of font specs.
i just call pango_font_family_get_name() and
pango_font_face_get_face_name() for getting parts of font name

so bug (if this is a bug) must be digged somewhere under yad

as a test and workaround try run yad in this form

LC_MESSAGES=C yad ...

On Sat, 19 Mar 2016 04:59:24 -0700 (PDT)
Ananda <anand...@gmail.com> wrote:

> Hello Victor,
> ... Unfortunately, I noticed this little issue:
>
>
>
>
>
> *# yad --fontBrush Script MT Italic 10# yad --font --separate-outputBrush
> Script MT|Italique|10# yad --font --separate-output --fontname="Brush
> Script MT *Italic
>
>
>
> * 10"Brush Script MT|Italique|10# yad --font --separate-output
> --fontname="Brush Script MT Italique 10"Sans|Regular|10# *
> Output style value in *(for my case) *French (*Italique*, instead of
> *Italic*) will not let the selector have the focus on the input font but on
> the default one (Sans...)
>
> Cordialement.
>

Ananda

unread,
Mar 21, 2016, 11:29:38 AM3/21/16
to yad-common
Hello Victor,
Thanks for your reply and sorry if I'm a little slow today but:

#  yad --font
Brush Script MT Italic 10
and:
#  yad --font --separate-output

Brush Script MT|Italique|10
#
Is there nothing to do to avoid output to be 'italique' instead of 'italic' while running the second command (with  --separate-output option)?
Unfortunately LC_MESSAGES=C seems to be inefficient.

Cordialement.

Victor Ananjevsky

unread,
Mar 21, 2016, 11:32:39 AM3/21/16
to yad-c...@googlegroups.com
can you upload the font itself or send it to ananasik AT gmail.com?

В Mon, 21 Mar 2016 08:29:38 -0700 (PDT)
Ananda <anand...@gmail.com> писал:

> Hello Victor,
> Thanks for your reply and sorry if I'm a little slow today but:
> # yad --font
> Brush Script MT Italic 10
> and:
> # yad --font --separate-output
> Brush Script MT|Italique|10
> #
> Is there nothing to do to avoid output to be '*italique*' instead of '
> *italic*' while running the second command *(with --separate-output
> option)*?
> > an email to yad-common+...@googlegroups.com <javascript:>.
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > Victor Ananjevsky <anan...@gmail.com <javascript:>>
Reply all
Reply to author
Forward
0 new messages