Monday, August 20, 2007

Summer of Code: Final Report

Today is the official end of the Google Summer of Code program. I've been both excited and nervous about the culmination of three months' worth of work on this judgment day. But no sense in worrying any longer; I will find out soon enough if I am to receive the coveted t-shirt and very useful final payment.

Here, I would like to share a summary of everything that I've done this summer for Inkscape. A written summary is made even more crucial by the nature of what I did in the second half of the program. While I laid down an important foundation for changes that can now be made much easier in the near future, there is not as much for the user to see quite yet.

Many of you already know my midterm impressions. As a quick reminder, during the first half of the summer, I implemented support for the <tref> element, as laid out in the SVG specification. This will let you use any character data from within the document in your own <text>, and as a bonus, any character markup from the original text will be ignored so you can easily add your own. You can't quite do this with <use>.

The work done in the second half is notably more complicated to explain. The end goal was initially twofold:
  1. Many fonts used in professional design can not be represented within the constraints of CSS. Take a font with a Shadow variant, such as Gill Sans, as an example -- there is no way to describe Gill Sans Shadow with CSS, as you can see in the CSS2 Spec. By adding our own Inkscape-specific information, we hoped to be able to use fonts like these at least within Inkscape.
  2. When it comes to listing font families and faces (aka styles) in our UI, we use Pango's answer to the question "which part of this font name is the family?" Unfortunately, this does not always lead to an ideal situation. What often happens is that several different faces that should be grouped together in the same family aren't. For example, you might see "Futura Bk BT", "Futura Hv BT", and "Futura Lt BT" listed as separate families, but would rather they were grouped together. We wanted to customize this process so we could control how families and styles were grouped together.
Ironically, neither of these two improvements is visible to the user in my latest code. It turns out that the first goal is almost certainly impossible to accomplish given the current state of Pango. The second goal is actually very much in reach, and can easily be implemented once the Summer of Code projects are complete.

What do I mean by the "current state of Pango" you ask? Well, as it turns out, the structure that is fundamental to our use of Pango, the PangoFontDescription, will only describe fonts that fit into the confines of CSS. So until the good folks at Pango decide to expand on what Pango can represent, we're stuck with what it already supports. (And yes, a little later on, I do plan on speaking with these good folks to find out why it is the way it is, and try to offer a helping hand to enhance it if that's what makes sense.)

But even if the PangoFontDescription did support what CSS can't, that doesn't really help us, right? After all, our SVG files use CSS to describe the fonts we're using anyway. That is true, and that's why I am adding a new attribute to an object's style string: -inkscape-font-specification. Here we will store a string that can fully represent a font no matter what its face is. The CSS will be updated as best it can be and used if there is no font specification available.

As for the second goal of cleaning up the family and style lists, the framework that makes this possible is in place, and only the code for converting the full font specification strings into the desired family and style for the UI needs to be set up. A fellow summer of coder has written code that may be appropriate for this, so after the deadline his code can be evaluated and re-purposed for this use. Everything should work well with only some possible minor tweaking.

So what does the user get to enjoy as a result of this work? Gone are the days of duplicate styles in the UI and styles that seem selectable but that just can't be used. Those fonts that Pango cannot handle aren't even listed, and those that just needed a little extra help now work. That means that every style listed in the Text and Styles dialog is now selectable! Hurray!

In conclusion, though it may not seem terribly exciting on the surface, this portion of my project has unlocked the door for some really great changes to be made in the very near future. Look forward to a more desirable grouping of families first, and hopefully we can get Pango to do for us what we really want next: support ALL fonts!

Wednesday, August 8, 2007

Looking Forward to School

The summer is flying by! What with Summer of Code and trying to plan my wedding (which is on August 24th), I haven't even had a chance to ride my motorcycle more than a few times this season let alone keep up with this blog.

Still, as the calendar flips over to August, thoughts of "back to school" start swimming in my head. Oddly enough, I always look forward to hitting the books again each September. This year is no different in that regard, but there is a new excitement in the fact that I will be returning to Carleton as a graduate student.

I've already registered for the five courses I will be taking in the first two semesters. I figured I'd share the title and description and see if you had any comments on the topics covered (love it or hate it, never heard of it, etc).

Computational Aspects of Geographic Information Systems

Computational perspective of geographic information systems (GIS). Data representations and their operations on raster and vector devices: e.g., quadtrees, grid files, digital elevation models, triangular irregular network models. Analysis and design of efficient algorithms for solving GIS problems: visibility queries, point location, facility location.

Advanced Topics in Computer Systems (from Systems and Computer Engineering)

Recent and advanced topics in computer systems. The course will generally focus on one or more of the following areas: specification, design, implementation, and modeling/analysis. Students may be expected to contribute to lectures or seminars on selected topics.

Applied Computational Geometry

Computer-based representation and manipulation of geometric objects. Design and analysis of efficient algorithms for solving geometric problems in applied fields such as Computer-Aided Design and Manufacturing, Cartography, Materials Science, and Geometric Network Design.

Topics in Medical Computing

Introductory course on data structures, algorithms, techniques, and software development related to medical computing (in particular spatial modeling). Topics may include: computational geometry algorithms for cancer treatment, medical imaging, spatial data compression algorithms, dynamic programming for DNA analysis.

Selected Topics in Computer Science: Computer Graphics

[No description available.]