'Set the customfonts.CustomTTFonts list to the content of the database'

def _sync(self):

    customfonts.CustomTTFonts = []
    local_family_modes = set()
    local_font_paths = {}
    for font in self.search([('path', '!=', '/dev/null')]):
        local_family_modes.add((font.family, font.mode))
        local_font_paths[font.name] = font.path
        customfonts.CustomTTFonts.append((font.family, font.name, font.path, font.mode))
    for (builtin_font_family, mode, alts) in BUILTIN_ALTERNATIVES:
        if ((builtin_font_family, mode) not in local_family_modes):
            for altern_font in alts:
                if local_font_paths.get(altern_font):
                    altern_def = (builtin_font_family, altern_font, local_font_paths[altern_font], mode)
                    customfonts.CustomTTFonts.append(altern_def)
                    _logger.debug('Builtin    remapping    %r', altern_def)
                    break
            else:
                _logger.warning('No    local    alternative    found    for    builtin    font    `%s`    (%s    mode).Consider    installing    the    DejaVu    fonts    if    you    have    problems    with    unicode    characters    in    RML    reports', builtin_font_family, mode)
    return True
