Here we report on spectroscopic measurements of the aluminum monofluoride molecule (AlF; boson) that are relevant to laser cooling and trapping experiments. We measure the detailed energy-level structure of AlF in the X1Σ+ electronic ground state, in the A1Π state, and in the metastable a3Π state. We determine the rotational, vibrational, and electronic branching ratios from the A1Π state. We also study how the rotational levels split and shift in external electric and magnetic fields. We find that AlF is an excellent candidate for laser cooling on any Q line of the A1Π - X1Σ+ transition and for trapping at high densities. The energy levels in the X1Σ+,v=0 state and within each Ω manifold in the a3Π,v=0 state are determined with a relative ...