  We study a two-Higgs-doublet model with four generalised CP symmetries in the
scalar sector. Electroweak symmetry breaking leads automatically to spontaneous
breaking of two of them. We require that these four CP symmetries can be
extended from the scalar sector to the full Lagrangian and call this
requirement the principle of maximal CP invariance. The Yukawa interactions of
the fermions are severely restricted by this requirement. In particular, a
single fermion family cannot be coupled to the Higgs fields. For two fermion
families, however, this is possible. Enforcing the absence of flavour-changing
neutral currents, we find degenerate masses in both families or one family
massless and one massive. In the latter case the Lagrangian is highly
symmetric, with the mass hierarchy being generated by electroweak symmetry
breaking. Adding a third family uncoupled to the Higgs fields and thus keeping
it massless we get a model which gives a rough approximation of some features
of the fermions observed in Nature. We discuss a number of predictions of the
model which may be checked in future experiments at the LHC.
