You are not logged in.

#1 2010-06-05 21:40:06

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Convert dzen .xbm icons to a font

Hello, big_smile

For various reasons, I would like to get rid of dzen2 and use a pure conky bar.
The problem is that I'm completely addicted to those small .xbm icons that fit so nicely in dzen's bar.

I was wondering if anyone knows if there is an easy way to convert dzen's .xbm icons to a font so that I can easily use it in a pure conky bar (I would like to obtain something like Open Logos to be clear).
Using conky's image support is not an option because... well it sucks, or at least is not intended to be used to place several icons on a bar...

Thank you! smile

Last edited by rent0n (2010-06-05 21:48:43)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#2 2010-06-05 21:52:07

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Convert dzen .xbm icons to a font

Not a conversion method, but Lokaltog has created an icon font for dwm: http://bbs.archlinux.org/viewtopic.php? … 36#p724236


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-06-06 00:48:33

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: Convert dzen .xbm icons to a font

Use fontforge, trace the bitmap and create a font. Fontforge is a great tool, very valuable.

EDIT. You can script fontforge with python, so you can write a program to automatic do the conversion for you. Do it one time manually so you know what you need to do and next time write a python script. I really recommend that you rebuild fontforge with --enable-pyextension so you can use fontforge as a python module (and use ipython for example)

EDIT I see new, they are really tiny, so you probably dont want to trace then but create a bitmap font

Last edited by kazuo (2010-06-06 01:31:39)

Offline

#4 2010-06-07 11:02:50

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Convert dzen .xbm icons to a font

jasonwryan wrote:

Not a conversion method, but Lokaltog has created an icon font for dwm: http://bbs.archlinux.org/viewtopic.php? … 36#p724236

Yes, this seems exactly what I was looking for, thank you! big_smile
I guess I can also create a new font from scratch rather than modyfing an existing one.

kazuo wrote:

Use fontforge, trace the bitmap and create a font. Fontforge is a great tool, very valuable.

EDIT. You can script fontforge with python, so you can write a program to automatic do the conversion for you. Do it one time manually so you know what you need to do and next time write a python script. I really recommend that you rebuild fontforge with --enable-pyextension so you can use fontforge as a python module (and use ipython for example)

EDIT I see new, they are really tiny, so you probably dont want to trace then but create a bitmap font

I've tried fontforge with this purpose but I failed (can't recall what went wrong, actually), so  I will try Lokaltog's method first. Thanks anyways!


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#5 2010-06-07 11:38:44

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: Convert dzen .xbm icons to a font

rent0n wrote:

I've tried fontforge with this purpose but I failed (can't recall what went wrong, actually), so  I will try Lokaltog's method first. Thanks anyways!

Works for me, I tested with the icons you linked. What iconset you want? I do it for you.

EDIT
I did it for the sm4tik set
sm4tik.png

http://fma.if.usp.br/~kazuo/sm4tik.tar.bz2

They are a bitmap fonts, but only the size 10 is real, all the others are scaled (ugly), nothing can be done about this, the original are so tiny.

Last edited by kazuo (2010-06-07 13:21:28)

Offline

#6 2010-06-07 13:47:44

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Convert dzen .xbm icons to a font

kazuo wrote:
rent0n wrote:

I've tried fontforge with this purpose but I failed (can't recall what went wrong, actually), so  I will try Lokaltog's method first. Thanks anyways!

Works for me, I tested with the icons you linked. What iconset you want? I do it for you.

EDIT
I did it for the sm4tik set
http://fma.if.usp.br/~kazuo/sm4tik.png

http://fma.if.usp.br/~kazuo/sm4tik.tar.bz2

They are a bitmap fonts, but only the size 10 is real, all the others are scaled (ugly), nothing can be done about this, the original are so tiny.

Awesome! sm4tik's icons were exactly what I was lookg for! I will test them in conky asap, thank you very much for your effort!


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#7 2010-06-07 15:44:20

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Convert dzen .xbm icons to a font

My only concern is that I intended to use them in their original size (8px) and they aren't rendered very well with size 8.
Is it possible to have a better rendering at size 8? roll


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#8 2010-06-07 16:23:13

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: Convert dzen .xbm icons to a font

Try this http://fma.if.usp.br/~kazuo/sm4tik.otf (delete the old pcf.gz)

This is a little monster, its is a vector font, but describe a bitmap like font (I upscaled the bdf in 600% and potraced it disabling the conversion of polygons to curves)... use this with xft, Its gonna be rendered in all sizes exactly equal (so much freetype can render then)

This is how this look. Looks good for me.

sm4tik:size=8
size_8.png
sm4tik:pixelsize=8
pixelsize_8.png
sm4tik:size=18
size_18.png

EDIT: You probably want to disable antialias too (sm4tik:size=n:antialias:false:autohint:false)
UPDATE: A otf version, to be future proof (and use cubics)

Last edited by kazuo (2010-06-07 16:53:51)

Offline

#9 2010-06-07 17:26:07

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Convert dzen .xbm icons to a font

kazuo wrote:

Try this http://fma.if.usp.br/~kazuo/sm4tik.otf (delete the old pcf.gz)

This is a little monster, its is a vector font, but describe a bitmap like font (I upscaled the bdf in 600% and potraced it disabling the conversion of polygons to curves)... use this with xft, Its gonna be rendered in all sizes exactly equal (so much freetype can render then)

This is how this look. Looks good for me.

sm4tik:size=8
http://fma.if.usp.br/~kazuo/size_8.png
sm4tik:pixelsize=8
http://fma.if.usp.br/~kazuo/pixelsize_8.png
sm4tik:size=18
http://fma.if.usp.br/~kazuo/size_18.png

EDIT: You probably want to disable antialias too (sm4tik:size=n:antialias:false:autohint:false)
UPDATE: A otf version, to be future proof (and use cubics)

Way better! lol
Thank you very much indeed for your work, I do really appreciate it!

Cheers,


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#10 2010-06-07 19:23:50

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Convert dzen .xbm icons to a font

Well, this is quite funny...it seems text is "going down" in conky:

40445164381558199723_thumb.jpg

This doesn't happen in other apps but it appears to be related to your font since removing it or disabling xft removes the weird effect too...
Have you got any ideas? big_smile

EDIT: here's my ~/.conkyrc:

#avoid flicker
double_buffer yes

#own window to run simultanious 2 or more conkys
own_window  yes
own_window_transparent no
own_window_type desktop
own_window_hints undecorate,sticky,skip_taskbar,skip_pager 
background yes

#borders
draw_borders no
border_inner_margin 1
border_outer_margin 0

#shades
draw_shades no

#position
gap_x 0
gap_y 0
alignment top_left

#behaviour
update_interval 0.2

#colour
default_color  999999
#default_shade_color 000000
own_window_colour 000000

#font
use_xft yes
font terminus:pixelsize=12

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale no

#to prevent window from moving
use_spacer none
minimum_size 1280
maximum_width 1280

# Network interface must have an ip address to be considered up
if_up_strictness address

TEXT
 ${desktop_name}${alignr}${if_mpd_playing}${font sm4tik:size=8}h${font} ${mpd_artist} - ${mpd_title} | ${endif}${font sm4tik:size=8}D${font} ${uptime_short} | ${font sm4tik:size=8}E${font} ${cpu cpu1}% ${font sm4tik:size=8}E${font} ${cpu cpu2}% ${font sm4tik:size=8}U${font} ${memperc}% | ${font sm4tik:size=8}G${font} ${fs_used_perc /}% ${font sm4tik:size=8}G${font} ${fs_used_perc /home}% | ${if_up wlan0} ${font sm4tik:size=8}W${font} wlan0${endif}${if_up eth0}${font sm4tik:size=8}c${font} eth0${endif} | ${font sm4tik:size=8}6${font} ${battery BAT1} | ${font sm4tik:size=8}f${font} ${execpi 3600 paconky /home/rent0n/.paconky/config} | ${font sm4tik:size=8

Last edited by rent0n (2010-06-07 19:25:24)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#11 2010-06-07 20:41:43

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: Convert dzen .xbm icons to a font

Uhhh.. strange, I'm investigating, in the process I recreated the font (and added a missing icon), get it from the same link.

But, look I get the same behavior with OpenLogos.
openlogos_conky.png

and even with generic font!!
serif_conky.png

But only if I set any font to use pixelsize, can you reproduce with this conkyrc?

own_window  yes
use_xft yes
xftfont terminus:pixelsize=12
TEXT
${font Openlogos:size=12}h${font}${font Openlogos:size=12}h${font}${font Openlogos:size=12}h${font}

my sm4tik font behavior the same with or without pixelsize set, but this behavior with Openlogos and a generic serif font suggest to me that this is a bug in conky.

EDIT.

I found a smaller case!!!

own_window  yes
TEXT
${font fixed}h${font}${font fixed}h${font}${font fixed}h${font}

fixed_conky.png

But this example is so trivial, that I'm thinking that my conky is fuck**, because conky cant be so bugged...

Last edited by kazuo (2010-06-07 20:50:32)

Offline

#12 2010-06-12 20:46:14

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: Convert dzen .xbm icons to a font

This is so irritating.
I've tried different things and I can't reproduce this behaviour with normal fonts like Sans or Fixed. Strangely enough I got a 'descending conky' with your font both using pixelsize and size, even if the latter goes down to a lesser extent...

Have you goy any hints with this regard?
Do you think I should report this as a conky bug?

Thank you.


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#13 2010-06-20 12:53:10

Aakko
Member
Registered: 2007-10-23
Posts: 65

Re: Convert dzen .xbm icons to a font

kazuo wrote:
rent0n wrote:

I've tried fontforge with this purpose but I failed (can't recall what went wrong, actually), so  I will try Lokaltog's method first. Thanks anyways!

Works for me, I tested with the icons you linked. What iconset you want? I do it for you.

EDIT
I did it for the sm4tik set
http://fma.if.usp.br/~kazuo/sm4tik.png

http://fma.if.usp.br/~kazuo/sm4tik.tar.bz2

They are a bitmap fonts, but only the size 10 is real, all the others are scaled (ugly), nothing can be done about this, the original are so tiny.

The link seems to be broken. Could you reupload the font?

Offline

#14 2011-12-17 20:32:40

sunaku
Member
From: /dev/tty
Registered: 2010-09-29
Posts: 140
Website

Re: Convert dzen .xbm icons to a font

I have created a new BDF font that encodes sm4tik's XBM icons into the first Unicode Private Use Area region (E000-F8FF) by their ASCII filename sorting order.  Enjoy! big_smile

Last edited by sunaku (2011-12-17 20:33:36)

Offline

Board footer

Powered by FluxBB