First, this is not just A340s which do this. Take a look at a profile schematic of a 767-400 - you'll notice that the ground is shown slanted. For that matter, look at almost any modern jet's schematic, the side view will show one of two things - either the ground is slanted so that the schematic can show a level fuselage, or the front nose gear is shown raised off the ground for the same reason, either way, on most modern jets the aircraft dose lean forward. This way the front gear can be shorter so it takes up less space when it is stowed, though I'm not sure what's so valuable about the space under the nose, and this allows the plane to rotate further on the runway... an additional degree of forward rotation is an additional degree of rotation. Anyway, it's not just on the A340. Lots of aircraft have this design.