alignment bug

Bug #1069919 reported by De Noyse on 2012-10-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I have two systems:
1. Arch Linux
2. Ubuntu 12.10

I added the Ubuntu PPA and installed it.

To test it on Arch, i both tested the uberwriter-bzr from AUR and downloaded the tar ball from launchpad (uberwriter_12.11.02-public1-beta, though it says 12.07.09 in the about dialog). In both, i commented out the few lines in regaring apt and it started normally.

While it works as expected on Ubuntu, i find an alignment bug in Arch Linux. In Ubuntu, all normal text is aligned equally, whereas special chars (hashes, enumerations, itemization) are in a kind of right aligned sidebar on the left. On Arch though, the left sidebar has a centered alignment, resulting in a missalignment of the text.

I uploaded an explaing screenshot. First the Arch, then the Ubuntu window.

I allmost forgot, here are all my python packages and versions on Arch, if it might be python-realted:

pyatspi 2.4.0-1
pygtk 2.24.0-3
pyrex 0.9.9-3
python 3.3.0-1
python-dbus-common 1.1.1-2
python2 2.7.3-2
python2-boto 2.5.2-1
python2-cairo 1.10.0-1
python2-crypto 2.6-3
python2-dbus 1.1.1-2
python2-gnupginterface 0.3.2-1
python2-gobject 3.2.2-2
python2-gobject2 2.28.6-8
python2-gtkspellcheck 4.0-1
python2-pyenchant 1.6.5-2
python2-xdg 0.23-2

vovkkk (vovkkk) wrote :

Hey De Noyse! I’m not a maintainer, but trying to contribute in project.

I see that typeface is actually different, as well as size of font. Did you change it?
So, please, try
1) to use the same font (Ubuntu Mono, 15pt);
2) to change width of the window;
and see if it'll fix alignment.

The issue actually exists in Ubuntu too, if making window narrower
So I assume we need rewrite calculations for margins. Another way would be to set min-width for window, but it’s lame way, in my view, although more easy.

1) did it. for arch i installed ttf-ubuntu-font-family

this makes me wonder, how the text is shifted. if it is font-specific, i asume the shifting is a fixed amount of pixels? maybe here lies a little potential.

i told wolf, that i might peek into the code. i do not know much python, but i might learn something. if i find time november/december, i might try to port it to pyhton3.

i will post a report in arch linux aur, that the fonts should be a dependancy

i just figured out that, if ttf-ubuntu-font-family is not installed, the editor falls back to a non-monospace font. maybe this is the cause for the missalignment. i don't know, but maybe it is easy to add a few lines to use (or at least fall back to) the systems default monospace font. this font is set system-wide anyway.

Wolf Vollprecht (w-vollprecht) wrote :

qHi Denoyse, you're making a good point there.

At the moment, the margins are not calculated based on a font, but hard coded into the program ... so yes, It won't work with another font. What would be possible is to look into the gEdit code and figure out if they have a method to find out the width of a monospace font.

I actually ported uberwriter to python 3 yesterday, and it's running good on python 3.2 .

You can check out the code if you like, the python 3 port is in the inline preview branch of me. (I know, branching is a little messy ... )

If you need more tips on the workflow / or how I run the program, feel free to ask (because it was made using quickly, and I am not sure whether that's available for arch ... Anyhow, it should be easy to write a shell script that does just the same as 'quickly run', compiling the glib schema and running bin/uberwriter.

If you need help, just let me know.

Maybe (as quick and dirty) code multiple alignments for the most common fonts. Ubuntu-mono (used in ubuntu), DejaVu sans mono (used in many gnome distros as default).

I have to travel next week. Possibility A: It gets boring and i have plenty of time to read your code. Possibility B: It gets veeeeeery stressy and i will not respond for the next 10 days ;-)

I will try the bzr branch on my ubuntu machine tonight....

Changed in uberwriter:
status: New → In Progress
Wolf Vollprecht (w-vollprecht) wrote :

Hi denoyse,

gEdit has some code ready for calculating the width of a space, because they use this to determine the tabwidth they need. E.g. 4 Spaces are one tab. So somewhere in there is some magic function to calculate that (I've read about it somewhere, but back then they said it's quite complicated). Anyhow, it could be a reference, and then it would be easy to have it working for any monospace font ...

Right now the branch I am working on and which isin python 3 is the inline preview.

BTW If you want to run it from command line on arch, try using quickly: (look into data/templates/ubuntu-application and then , thats what I am using to develop.

Have fun traveling

Wolf Vollprecht (w-vollprecht) wrote :

I've just added the ttf-ubuntu-font-family dependency to the debian/control file, so that should be resolved (at least for all debian distro's that have access to that package)

Cheers Wolf

PS did you manage to look over the code?

Changed in uberwriter:
status: In Progress → Fix Committed
Changed in uberwriter:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers