Transform Tool - lock XYZ axis option or snap to surface for Gizmo Matrix.
If you could lock an axis with the transform tool, then it would be possible to snap precisely on a surface with the pencil without moving the object in the other directions.
Or a snap option for manual translation for the Gizmo matrix.