We analyse the magnetic support of solar prominences in two-dimensional linear force-free fields. The prominence is modeled as a vertical current sheet with mass in equilibrium between gravity and magnetic forces. We use a finite difference numerical technique which incorporates both vertical photospheric and horizontal prominence magnetic field observations. A current singularity is generally present in this mixed boundary value problem at both the bottom and top of the prominence, because the imposed boundary conditions are of different nature inside and outside the prominence on the vertical axis. This unphysical property is overcome by a modification of the initial boundary condition: only the observable vertical dependence of the horizontal prominence field is retained. As a result both the magnetic flux crossing in and below the prominence are parameters determined by the solution rather than imposed ones. The precision of the computations, and in particular the numerical removal of singularities, is tested in the potential limit using known analytical solutions. With the linear force-free hypothesis, the bipolar and quadrupolar regions are found to be associated with normal and inverse prominence polarity, respectively. This applies for the field component orthogonal to the prominence, as introduced previously by Priest 1989, but can be extended to the component parallel to the prominence in the same way. For bipolar regions an upwardly decreasing magnetic field in the prominence is needed, while quadrupolar regions can have a slightly increasing field strength. In both cases an increase of magnetic shear decreases the mass supported for a given vertical dependence of the field component orthogonal to the prominence.