Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id r6A2SAqd005254 for ; Wed, 10 Jul 2013 04:28:11 +0200 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx009) with ESMTP (Nemesis) id 0LrJQi-1UBHJJ09qm-0138s3 for ; Wed, 10 Jul 2013 04:28:05 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r6A2PO8I018865 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Jul 2013 04:25:25 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r69M141B013743; Wed, 10 Jul 2013 04:25:24 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 10265675 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 10 Jul 2013 04:25:24 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r6A2POgh026559 for ; Wed, 10 Jul 2013 04:25:24 +0200 Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r6A2PFJ1015742 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Wed, 10 Jul 2013 04:25:19 +0200 Received: by mail-pb0-f50.google.com with SMTP id wz7so6177126pbc.37 for ; Tue, 09 Jul 2013 19:25:15 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.189.225 with SMTP id gl1mr31048987pac.22.1373423114861; Tue, 09 Jul 2013 19:25:14 -0700 (PDT) Received: by 10.66.150.226 with HTTP; Tue, 9 Jul 2013 19:25:14 -0700 (PDT) References: Content-Type: text/plain; charset=windows-1252 X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id r6A2POgh026560 Message-ID: Date: Tue, 9 Jul 2013 22:25:14 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: Using l3keys: choices, property-lists, defaults To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id r6A2PO8I018865 Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:tSQvy/YIU6s=:G601eEd/WGRLaKi/ZmQgLY kLdy3YlKGC+RHgs+64xICqB/Vn6g5hbRyKH8A1zo5OdK/yX0P0CSW18l7Vh/19c434BjK5I zU/kzImwKjcF27e1w1p4Ibzrrb615taWIVQcNRQOHreMTn+vtncNJD10YysCIo5ohwmpBq/ 3aoGaaEbY3ei515pjOcBKeTvpwYFnvwnsS+zCQQ6x3JClSzzLeFnbBLbLqCzcrLCJMw1HQk k0XSROQHq+WOP+dCmWHO8z4WeNZin6Jhhfz73LMaEg5sLn5Ma6HJHQxq7ihekthmQ2eU+bs iKPvNF9lEqVwvi2uFFiSX1DxL6svS/rO2kp2TkzFvsoaN5Tdr9ejejzDT8DqGVMymHsBha/ ECMoIvn0uEtze/dUT2u8KUqr+nfB9rR7KfLf/dWoRrcVjw9vnqZpIjiPAEnYqmm/qGOypQh RHlesxXGYNvn0O26dnK2TA7xyzRmZNpXiZ02bdMYbSiSwYyablbHhraGeWPdtZN56EnyBjI HZTgv0RRH2nBsjxHGR4zBpqxCgqt73flwiw5td8qPHzv7JNlrnrzJ+RJhG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A=:u3hsg/FfCyCIk1gSSyNAUnqTKey/dcpXeGmsSC7ahhM= Status: R X-Status: X-Keywords: X-UID: 7228 Hi, As you described, using a clist to store the set of available fonts and using \str_case to provide the various codes is a bit error-prone, and the correct structure is a property list matching directly each font name to the corresponding code. > \prop_new:N \g_jcs_fontcode_prop > > \prop_gput:Nnn \g_jcs_fontcode_prop { lmodern } { =85 } > > \bool_if:nT { \xetex_if_engine_p: || \luatex_if_engine_p: } > { \prop_gput:Nnn \g_jcs_fontcode_prop { fontin } { =85 } } If you have many fonts, it makes sense to introduce a function that puts code into the prop (that's a very simple wrapper, but helps to see what you are doing). \prop_new:N \g_jcs_fontcode_prop \cs_new_protected:Npn \jcs_define_font:nn #1 { \prop_gput:Nnn \g_ics_fontcode_prop {#1} } \jcs_define_font:nn { lmodern } { =85 } \bool_if:nT { \xetex_if_engine_p: || \luatex_if_engine_p: } { \jcs_define_font:nn { fontin } { =85 } } ... The part of your code where you extract the code for the font and store it in order to apply it after all options have been processed is indeed the correct way to go. However, since you are giving an ".initial:V" value which always sets \g_jcs_fontcode_tl at key definition time, you can simplify the F branch of \prop_get:NnNTF as follows \prop_get:NnNTF \g_jcs_fontcode_prop {#1} \l_jcs_fontcode_tl { \tl_gset_eq:NN \g_jcs_fontcode_tl \l_jcs_fontcode_tl } { \msg_warning:nnn { jcsres } { unknown-font-option } { #1 } } > Does this begin to sound like the way forward? Yes Bruno