Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about programming (old posts, page 54)

Bookrest: the stylesheet editor in action

As usu­al, a video show­ing it:

The cur­rent sta­tus is that the in­fra­struc­ture re­quired for the stylesheet ed­i­tor is in place:

  • I fig­ured out how to turn the StyleSheet ob­­ject back in­­­to a JSON stylesheet.

  • The changes are done and merged back in­­­to the same file.

  • There is UI for 3 of the 6 re­quired pieces. The mis­s­ing ones are text styles, em­bed­d­ed fonts, and con­­fig op­­tions (like, break sub­­sec­­tions to odd pages)

  • The UI for the whole app is pret­­ty rough, I am in full make-it-­­func­­tion­al mode right now. It will be rethought lat­er on.

Video: My lightning talk about Peter Norvig's spellchecker (in spanish)

Thanks to Nicolás Pace, I got a video of the Py­con Ar­genti­na 2009 light­ning talk­s.

So, af­ter fight­ing my ig­no­rance of video edit­ing, here is my own talk, about Pe­ter Norvig's spellcheck­er, spliced with the slides.

If you want a bet­ter qual­i­ty ver­sion of the slides, they are here

There is a prob­lem in that no mat­ter how I cut the orig­i­nal hour-­long video, re­gard­less of what tool I use, the sound gets out of sync, so I look kin­da odd. I will try to do an­oth­er ver­sion from the orig­i­nal video lat­er on.

So, here it is:

Edit­ed with kden­live: crashy but cool and easy

Dear Lazyweb, what's the pythonic cross-platform fc-match?

Here's what fc-­match does:

$ fc-match "Droid Sans"
DroidSans.ttf: "Droid Sans" "Regular"

Or even:

$ fc-match "Droid Sans" -v | grep file:
      file: "/usr/share/fonts/TTF/DroidSans.ttf"

So, how does one do that, go­ing from a font fam­i­ly name or font name to a font file, where there's no font­con­fig?

I found code for this in mat­plotlib's font_­man­ag­er mod­ule but it looks hard to un­tan­gle, and re­quir­ing mat­plotlib is a bit over the top.

If there's no por­ta­ble so­lu­tion, I would be hap­py enough with three stand­alone so­lu­tions in­stead, and prom­ise to pub­lish an ab­strac­tion lay­er over them ;-)

So, dear win­dows and mac python­istas, any point­er­s?

Bookrest: it was meant to be a stylesheet editor.

In my orig­i­nal post about it I was re­fer­ring to Bookrest as a stylesheet ed­i­tor for rst2pdf, be­cause that's what I want­ed, a way to test style changes and see what they did.

Of course, one thing lead to an­oth­er and it's start­ing to look more like a word pro­ces­sor than any­thing else, but ... well, how about a stylesheet ed­i­tor?

Sure, you can use the "Style" tab, and ed­it at will, but that's not ex­act­ly fun for ev­ery­one.

So, let's work on one. Here's the video of the cur­rent sta­tus:

Of course, this is about 1/20th of the stylesheet ed­i­tor, but at least the di­a­log is there, and most of the re­main­ing work is wiring di­alogs, which is quick us­ing de­sign­er.

It shall be called Bookrest, and it has an outline view.

Yes, the pro­gram known so far as "my rst2pdf ed­i­tor/pre­view­er ap­pli­ca­tion" is now called Bookrest.

What's a bookrest? It's a thing you put a book on.

Why Bookrest? I hope some­day peo­ple will have books open in bookrest. Plus, it ends with "rest", which is the pre­ferred ab­bre­vi­a­tion for re­Struc­tured Tex­t.

And what's the out­line view? It's a click­able tree with the out­line of the doc­u­men­t, of course.

As usu­al, let's go to the video:

The back­ground ren­der­ing was done us­ing python's awe­some mul­ti­pro­cess­ing mod­ule.


Contents © 2000-2024 Roberto Alsina