Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Fontconfig related types 
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Author: Ivan Gyurdiev <ivg2@cornell.edu>
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# fontconfig_domain(role_prefix) - create fontconfig domain
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# read_fonts(domain, role_prefix) - 
Chris PeBenito ab58ad
#         allow domain to read fonts, optionally per/user
Chris PeBenito ab58ad
#  
Chris PeBenito ab58ad
Chris PeBenito ab58ad
define(`fontconfig_domain', `
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type $1_fonts_t, file_type, $1_file_type, sysadmfile;
Chris PeBenito ab58ad
type $1_fonts_config_t, file_type, $1_file_type, sysadmfile;
Chris PeBenito ab58ad
type $1_fonts_cache_t, file_type, $1_file_type, sysadmfile;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
create_dir_file($1_t, $1_fonts_t)
Chris PeBenito ab58ad
allow $1_t $1_fonts_t:{ dir file } { relabelto relabelfrom };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
create_dir_file($1_t, $1_fonts_config_t)
Chris PeBenito ab58ad
allow $1_t $1_fonts_config_t:file { relabelto relabelfrom };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# For startup relabel
Chris PeBenito ab58ad
allow $1_t $1_fonts_cache_t:{ dir file } { relabelto relabelfrom };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
') dnl fontconfig_domain
Chris PeBenito ab58ad
Chris PeBenito ab58ad
####################
Chris PeBenito ab58ad
Chris PeBenito ab58ad
define(`read_fonts', `
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Read global fonts and font config
Chris PeBenito ab58ad
r_dir_file($1, fonts_t)
Chris PeBenito ab58ad
r_dir_file($1, etc_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifelse(`$2', `', `', `
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Manipulate the global font cache
Chris PeBenito ab58ad
create_dir_file($1, $2_fonts_cache_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Read per user fonts and font config
Chris PeBenito ab58ad
r_dir_file($1, $2_fonts_t)
Chris PeBenito ab58ad
r_dir_file($1, $2_fonts_config_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# There are some fonts in .gnome2
Chris PeBenito ab58ad
ifdef(`gnome.te', `
Chris PeBenito ab58ad
allow $1 $2_gnome_settings_t:dir { getattr search };
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
') dnl ifelse
Chris PeBenito ab58ad
') dnl read_fonts