It's been a while for me since I last looked at the OpenTTD, last time I remember doing something with TDD it ages back to 2004. At that moment unicode support hadn't been implemented yet and thus Russian translation of the game had been using latin1 "translit encoding" instead of normal cyrillic alphabet. Back to those days I've spent some time implementing a Russian-font NewGRF and rewriting translation to use cyrillic alphabet. Several months later that work was obsoleted by newly implemented unicode support in trunk

As it is well known, with the 1.2 release things got quite disappointing wrt 32bit graphics support. Prior to 1.2 plain png 32bpp was supported (with extra-zoom levels if using out-of-tree patch) and one could easily install and use lots of freely available 32bpp sprite packs (most of them were with unclean licensing policy, but its not the thing "usual player" would care about). Release 1.2 introduced official 2x and 4x zoom levels support, but at the same time removed support of the "plain png files" for sprites. All existing 32bpp packs were expected to be converted into new 32bpp NewGRF format, but it was mostly impossible to do "officially" due to licensing concerns. Net result is that half a year past the 1.2 release we still have to stick with the original (or OpenGFX) supplied 8bpp sprites for the most part, making the game look "not up to the 2012 standards" at 2x and 4x zoom levels.
Some of the existing 32bpp sprites were accompanied with permissive licensing, so I had tried to play a bit with a number of them trying to produce 32bpp NewGRFs. To prevent some questions: I know that it is possible to bulk-convert so-called "32bpp dev megapack" - and I had done it for myself - but my intention was to try to produce some NewGRFs which could be distributed in a (mostly) license-compliant way and could be used by end-users up until to the moment when OpenGFX+ (or some other) team would catch up and - hopefully - release full 32bpp baseset.
As land and field tiles by Ben Robbins already were converted into NewGRFs and as Ben Robbins had released all of his TTD-related gfx work posted to the tt-forums under GPLv2 and as this work included 32bpp 4x zoom sprites for fences - I had decided to try to convert fences into NewGRF as a "first attempt to so something".
Writing nfo file and composing grf wasn't a hard task really (some shell-fu magic is all that needed to do the trick, IMO its not worth bothering with NML when dealing with simple sprites replacements), but the produced visual result wan't perfect: fences seemed to be located where they should be - i.e. at the edges of the tiles - but the alignment at the corner crossing was certainly off (i.e. some corners looked like "X" instead of "L" in shape). Playing a bit with OpenTTD's built-in NewGRF alignment tool and analyzing how does the corner crossing look for different directions I've come to a conclusion that with current engine implementation for fences it might be impossible to align their sprites in a way that fences would be (a) continous and (b) align precisely at corner crossings.
In order to prove this assumption I've took a look into OpenTTD source and it seems that I had found the answer (dig into "src/clear_cmd.cpp" and "src/table/clear_land.h" for actual code).
Here is the math:
a) Tiles in TTD world use isometric projection of the pseudo-3D world, with tile coordinate system used having it's base point at the north corner of the tile, X axis is directed south-west (i.e. downwards and to the left) collinear with the northwest edge of the tile. Z axis is "height" and after projection "shifts" sprite up at the screen space, Y axis is similar to X but is collinear with the north-east edge of the tile. Tile has the square shape if looked from above (i.e. when projected orthogonally to a plane which is orthogonal to Z axis) with edges being 16 "units" wide. Projection is done in a way that after the projection to a screen space flat tile looks like rhomb with longer diagonal being 64 pixels wide (normal zoom) and shorter diagonal being 32 pixels wide. It gives us 16x16 units wide XY coordinate space per a flat tile.
b) Fences are a part of the so-called "base tile set" and like some other base tile set sprites doesn't have bounding box defined for them. Fences placement relative to the tile is handled by the game engine itself (i.e. it is hard-coded into the source and there are no means of changing it other than patching the source and recompiling the engine), and the engine uses the same sprites for north-west/south-east and north-east/south-west fences. Things are a bit more complicated for sloped tiles, but the general point is the same: shared sprite being used whenever possible. From this "sharing" fact one conclusion could be made: there's no way to distinctively align fences for sides that use shared sprite. Change the alignment for the sprite that is being used for north-west and you would at the same time change the alignment of the south-east fence. Same for north-east and south-west, e.t.c.
c) Actual fence placement inside the tile is not aligned with 16 "units" granularity on the X and Y sides by the engine, fences are placed with the assumption that they are 15 units in length. In other words, coordinates for fences vertex inside the like are (0;0), (0;15), (15;15) and (15;0). It is illustrated on the Pic.1 I attach to this message (click on thumbnail to the bottom to see it fullsize). And here is the core of the problem - it means that by the nature of engine fence placement they are not expected to be continous - i.e. there are 1 "unit" wide gaps between placed fences at the neighboring tiles.
Common misbelieve is that "fencing could be aligned properly - as they are in base set, it's just designer/artist hands that should be fixed".
It is wrong, and here is pic.2 which demonstrates why (original Windows TTD baseset used):

OK, so now we know the problem. How could we solve it?
As I had already written on Pic.1, one could simply accept the fact that the fences are not expected to be continous and that some crossings wouldn't be "perfect" and live with it. It is totally possible to do right now and I had done it. Results are, ughm, not the most visually pleasant thing I'd ever seen.
Here are screenshots so one would be able to judje by himself (be sure to click on thumbnails to see _the_real_ picture!):
Zoom 4x:




Zoom 2x:


Normal zoom:


That's it. For now I had only "fixed" normal fences, hedges and stone fences are to be looked at. It could be seen that the gaps between fences are barely noticeable at "Normal" zoom level. My next experiment would be try to patch the engine so it would place the fences aligned to 16 unit grid and check if that would "fix" the things in the way I expect it. Be tuned

P.S. I'm going to post here resulting NewGRF + sources as soon as I would make sure that there are not licensing problems with used sprites and would be more or less satisfied with the achieved visual results. Comments concerning licensing issues for the used sprites are welcome. Also I'm in search for "stone fence" sprites as the 32bpp fences "tar" I have use "hedge" sprites by Ben Robbins for both hedges and stone fences, and that's not what I want

P.P.S. Any NFO, GRF or source code files I post to this forum which are written by me or contain some amount of changes done by me are licensed under GNU/GPL v2 license unless specifically stated otherwise. In case the work posted is based on sources which are licensed in incompatible way with GNU/GPLv2 it should be assumed that I license my changes in a way that is compatible with the licensing of the original work. I.e., if the original work was licensed under creative commons derivate - my changes are assumed to be licensed the same. Same stands for other widely used "liberate" licensing schemes, like "BSD-style", "Apache", e.t.c.