Real-space description of semiconducting band gaps in substitutional systems