David, Sorry it took me so long to get back to you on this. Great explanation, and as you surmised I think the shifts we were seeing are not a regression in the code but rather cases where the defaults were being applied from load_map and being set to BOTTOM rather than middle. Simple really, sorry i missed that. So, the patch you send which I am about to apply to fix the defaults for both Shield and Text symbolizer vertical_alignment to MIDDLE does the trick. I will post a bit more info on the ticket here after I apply:
http://trac.mapnik.org/ticket/468 Thanks! Dane On Dec 15, 2009, at 9:31 PM, David Eastcott wrote: > Hi Dane, > > 1. The default values for vertical alignment have not changed > since r1043 and are still bottom. However, r1341 did change the > behaviour in a couple ways, see 3 below. > > Attached is a simple diff against trunk.1496 that changes the > default vertical alignment for both text_symbolizer and > shield_symbolizer to 'MIDDLE'. > > There were two files involved: text_symbolizer.cpp: changed > the variable initializer in two places > load_map.cpp: changed the default value, if not specified, for > both the text and shield symbolizer methods. I was not sure > if the shield should be changed, but thought they should be > consistent. I'll let you / Artem decide. > > 2. Ticket #468 > > Can I add comments directly to the ticket, or is it best to > correspond by email? > > 3. One of the problems that I encountered with vertical text > placement was its asymmetrical behaviour when using bottom, middle > and top; especially when multiple lines were involved. The changes > made were to make the placement of text symmetrical, regardless of > text size changes and which alignment option was used. > Regardless, I'll have to setup a before and after test environment. > It will be the weekend before I can get back to you on this > However, could you get more information from ?Colin? > a) the exact mapnik xml style text used to render the text > 'brandaussiche' and the image to its right that I am assuming is > related to it. > b) if possible, the revision of mapnik used for 'before_good' and > 'after_bad'. > > From looking at the two images, I am not certain what would be > causing such a large shift; based on the code and the style, a > couple pixels might be expected, but not half the text height. > > Best regards, > Dave > > > Dane Springmeyer wrote: >> Hello David, >> >> Regarding the subtle label placement shift... >> >> I've created http://trac.mapnik.org/ticket/468 to track the issue. >> >> It appears that after r1341 the default middle or 'baseline' >> placement is lower, as if it is bottom placement. >> >> Note the text 'brandaussiche' between these two images that a >> fellow user just created who also noticed the issue: >> >> http://oerks.net/~colin/before_good.png >> >> http://oerks.net/~colin/after_bad.png >> >> He noticed it because it is the same default position as pre >> http://trac.mapnik.org/changeset/1043 >> . >> >> I'm not terribly familiar with the placement algorithms but I can >> confirm that the middle/baseline placement should be the default, >> and perhaps some of the oddity is coming from the fact that r1043, >> while it apparently fixed the behavior, it did not properly set the >> default value here: >> >> http://trac.mapnik.org/browser/trunk/src/text_symbolizer.cpp?rev=1043#L89 >> >> to... >> >> valign_(MIDDLE), >> >> I just confirmed with Artem by way of chat that this is the desired >> setting, so if you have a chance to look at this soon that would be >> hugely helpful. >> >> Cheers, >> >> Dane >> >> >> >> > _______________________________________________ Mapnik-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-devel
