From: <gn...@th...> - 2005-03-03 05:43:22
|
Hi, I changed fo_context_util_border_resolve() to understand border-color. It appears to be working! > fo_context_util_border_resolve() currently does practically the same > thing twelve different ways: it resolves the absolute and relative > properties for each of 'color', 'width', and 'style' for each of the > four borders of an FO that has borders. > ... > fo_context_util_padding_resolve() takes a different approach to the > fact that you do practically the same thing for each of the four > sides: rather than copying the code four times with slightly different > function names each time, fo_context_util_padding_resolve() leaves all > the processing to the resolve_absolute_relative_padding() function and > just calls it four times with the values appropriate for each side. > > In principle, that's a technique that will scale better when xmlroff > gets around to handling reference-orientation, since when the > relationship between relative and absolute is no longer fixed, you > really don't want a single function that's 16 times as long as > resolve_absolute_relative_padding() just to do nearly the same thing > 16 times over. Yeah, I see what you mean. It seems like borders, as I'm sure you're aware, are maybe the ugliest in terms of shorthands, relative vs. absolute, etc. since there is the overall "border" shorthand, the shorthands "border-color", "border-style", and "border-width", the shorthands "border-top", "border-bottom", "border-left", and "border-right", and then the specific relative and absolute attributes for style, color, and width. Again, the spec is super-clear about the precedence/resolution rules, but it's a lot more overlap/hierarchy. So I guess it would be nice to separate out a function somehow like resolve_absolute_relative_padding() to avoid a really long if-else nesting hell, but it will still be a lot more complicated than padding, right? What's the preferred way of creating and submitting a patch? If you can't tell, I'm new at the whole contributing-to-open-source-projects thing. In the unrelated-but-hindering-stuff department, the pdf's I'm generating have no visible text in them. I'll look at making sure I have the right versions of packages installed (are fontconfig and freetype the most relevant ones here?), but just seeing if you have a hunch what my environment is missing - I don't know much of anything about fonts. Thanks for all the explanations. Thanks, Julian |