We describe Gauss-type maps as geometric realizations of certain codes in the monoid of nonnegative matrices in the extended modular group. Each such code, together with an appropriate choice of unimodular intervals in P1R\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$${{\\,\ extrm{P}\\,}}^1\\mathbb {R}$$\\end{document}, determines a dual pair of graph-directed iterated function systems, whose attractors contain intervals and constitute the domains of a dual pair of Gauss-type maps. Our framework covers many continued fraction algorithms (such as Farey fractions, Ceiling, Even and Odd, Nearest Integer, …\\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\ldots $$\\end{document}) and provides explicit dual algorithms and characterizations of those quadratic irrationals having a purely periodic expansion.