From 467072618a44c6dbb98901f6192fbbf2e91425b1 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 8 Jan 2005 12:30:11 +0000 Subject: [PATCH] new file. --- lily/output-def-scheme.cc | 35 +++++++++++++++++++++++++++++++ lily/paper-def.cc | 32 ---------------------------- lily/tweak-registration-scheme.cc | 2 ++ 3 files changed, 37 insertions(+), 32 deletions(-) diff --git a/lily/output-def-scheme.cc b/lily/output-def-scheme.cc index 88d6f28c49..b22f434071 100644 --- a/lily/output-def-scheme.cc +++ b/lily/output-def-scheme.cc @@ -8,6 +8,8 @@ */ #include "font-metric.hh" +#include "pango-font.hh" +#include "modified-font-metric.hh" #include "output-def.hh" #include "ly-module.hh" #include "context-def.hh" @@ -121,3 +123,36 @@ LY_DEFINE (ly_paper_get_number, "ly:paper-get-number", 2, 0, 0, __FUNCTION__, "layout definition"); return scm_make_real (layout->get_dimension (name)); } + +LY_DEFINE (ly_paper_fonts, "ly:paper-fonts", + 1, 0, 0, + (SCM bp), + "Return fonts from the @code{\\paper} block @var{bp}.") +{ + Output_def *b = unsmob_output_def (bp); + + SCM font_table = b->lookup_variable (ly_symbol2scm ("scaled-fonts")); + + SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper"); + + SCM ell = SCM_EOL; + if (scm_hash_table_p (font_table) == SCM_BOOL_T) + { + SCM func = ly_lily_module_constant ("hash-table->alist"); + + for (SCM s = scm_call_1 (func, font_table); scm_is_pair (s); + s = scm_cdr (s)) + { + SCM entry = scm_car (s); + for (SCM t = scm_cdr (entry); scm_is_pair (t); t = scm_cdr (t)) + { + Font_metric *fm = unsmob_metrics (scm_cdar (t)); + + if (dynamic_cast (fm) + || dynamic_cast (fm)) + ell = scm_cons (fm->self_scm (), ell); + } + } + } + return ell; +} diff --git a/lily/paper-def.cc b/lily/paper-def.cc index a46fb43fc1..3606356169 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -73,35 +73,3 @@ scale_output_def (Output_def *o, Real amount) return unsmob_output_def (new_pap); } -LY_DEFINE (ly_paper_fonts, "ly:paper-fonts", - 1, 0, 0, - (SCM bp), - "Return fonts from the @code{\\paper} block @var{bp}.") -{ - Output_def *b = unsmob_output_def (bp); - - SCM font_table = b->lookup_variable (ly_symbol2scm ("scaled-fonts")); - - SCM_ASSERT_TYPE (b, bp, SCM_ARG1, __FUNCTION__, "paper"); - - SCM ell = SCM_EOL; - if (scm_hash_table_p (font_table) == SCM_BOOL_T) - { - SCM func = ly_lily_module_constant ("hash-table->alist"); - - for (SCM s = scm_call_1 (func, font_table); scm_is_pair (s); - s = scm_cdr (s)) - { - SCM entry = scm_car (s); - for (SCM t = scm_cdr (entry); scm_is_pair (t); t = scm_cdr (t)) - { - Font_metric *fm = unsmob_metrics (scm_cdar (t)); - - if (dynamic_cast (fm) - || dynamic_cast (fm)) - ell = scm_cons (fm->self_scm (), ell); - } - } - } - return ell; -} diff --git a/lily/tweak-registration-scheme.cc b/lily/tweak-registration-scheme.cc index a77aeb3150..7bc17dfe3c 100644 --- a/lily/tweak-registration-scheme.cc +++ b/lily/tweak-registration-scheme.cc @@ -9,6 +9,8 @@ #include "tweak-registration.hh" +#include "grob.hh" +#include "object-key-undumper.hh" LY_DEFINE(ly_clear_tweak_registry, "ly:tweak-clear-registry", 0,0,0,(), -- 2.39.5