summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--letterspace.tex170
-rw-r--r--t-letterspace.xml66
2 files changed, 236 insertions, 0 deletions
diff --git a/letterspace.tex b/letterspace.tex
new file mode 100644
index 0000000..5cca7a0
--- /dev/null
+++ b/letterspace.tex
@@ -0,0 +1,170 @@
+\usemodule [letterspace]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Font Setups %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\definefontfeature [default] [default] [
+ protrusion=quality,
+ expansion=quality,
+ mode=node,
+ script=latn,
+ onum=yes,
+ dlig=yes,
+ liga=yes,
+]
+
+\usetypescript [antykwa-poltawskiego]
+\setupbodyfont [antykwa-poltawskiego,10pt]
+
+\usetypescript [serif] [hz] [highquality]
+\setupalign [hanging,hz]
+
+\setupbodyfontenvironment [default] [12pt] [interlinespace=15pt]
+\setupbodyfontenvironment [default] [11pt] [interlinespace=13pt]
+\setupbodyfontenvironment [default] [10pt] [interlinespace=12pt]
+\setupbodyfontenvironment [default] [9pt] [interlinespace=11pt]
+\setupbodyfontenvironment [default] [8pt] [interlinespace=10pt]
+
+\setupbodyfontenvironment [default] [em=italic]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Presenting the Interface %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\usemodule [int-load]
+\loadsetups [t-letterspace.xml]
+
+\define\beautifyshowsetups{%
+ \unexpanded\def\setupnumfont {\rm}%
+ \unexpanded\def\setuptxtfont {\rm}%
+ \unexpanded\def\setupintfont {\rm\sc\Word}%
+ \unexpanded\def\setupvarfont {\rm\it}%
+ \unexpanded\def\setupoptfont {\rm\it}%
+ \unexpanded\def\setupalwcolor {gutenred}%
+ \unexpanded\def\setupoptcolor {gutenred}%
+ \defineframedtext [setuptext] [
+ frame=off,
+ background=color,
+ backgroundcolor=gray:2,
+ width=\hsize,
+ height=fit,
+ align=right,
+ offset=0.75em,
+ ]%
+}
+
+\let\Oldshowsetup\showsetup
+
+\define[1]\showsetup{% hurray for diversity
+ \bgroup\beautifyshowsetups%
+ \Oldshowsetup{#1}%
+ \egroup%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Paper %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\definepapersize[LHS][
+ width=160mm,
+ height=239mm,
+]
+
+\setuppapersize[LHS][LHS]
+
+\showframe
+\setuplayout [
+ width=122mm,
+ %textheight=199mm, % ca. 47 rows * 12pt
+ height=224mm, % text height should end up at ca. 47 rows * 12pt
+ %height=fit,
+ %
+ topspace=14mm,
+ header=12pt,
+ headerdistance=4mm,
+ top=00mm,
+ %
+ bottomspace=0mm,
+ footer=23mm,
+ bottom=0mm,
+ footerdistance=0mm,
+ %
+ backspace=16mm,
+ leftedge=0mm,
+ leftedgedistance=0mm,
+ leftmargin=16mm,
+ leftmargindistance=1em,
+ %
+ rightmargin=20mm,
+ rightmargindistance=2mm,
+ rightedge=0mm,
+ rightedgedistance=0mm,
+]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Interaction %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\definecolor [gutenred] [x=bf221f] % rubrication from digitized_Göttingen Gutenberg bible
+
+\setupinteraction[%
+ state=start,
+ color=gutenred,
+ contrastcolor=gutenred,
+ %color=,
+ %contrastcolor=,
+ style=,
+ focus=standard,
+ title={Letterspace Module},
+ subtitle={Bringing Flow into Horizontal Spacing},
+ author={Philipp Gesang},
+ keyword={ConTeXt, LuaTeX, letterspacing, horizontal glue},
+]
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Misc %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\clubpenalty -7000
+\widowpenalty -7000
+
+
+
+\starttext
+\setuppagenumbering[state=stop,location=]
+
+The
+
+Letterspace Module
+
+for Context mkiv
+
+a Contribution to horizontal movement
+
+\page
+
+© 2011-03-16 {\italic Philipp Gesang}, Heidelberg
+
+\page[odd]
+\setuppagenumbering[state=start,alternative=doublesided,location={right,header}]
+\title{Content}
+
+\placelist[chapter,section][criterium=all]
+
+\chapter{Commands}
+
+\showsetup{setupletterspace}
+\showsetup{defineletterspace}
+\showsetup{letterspace}
+\showsetup{startletterspace}
+
+\chapter{Applications}
+
+\section{Emphasis}
+
+\section{Capital Spacing}
+
+
+\stoptext
diff --git a/t-letterspace.xml b/t-letterspace.xml
new file mode 100644
index 0000000..c9bba2c
--- /dev/null
+++ b/t-letterspace.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands"
+ name="context"
+ language="en"
+ version="2011-03-16T10:30:36+0100">
+
+ <cd:command name="setupletterspace" file="t-letterspace.mkiv">
+ <cd:sequence>
+ <cd:string value="setupletterspace"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords n="1" optional="yes">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:assignments n="2" list="yes" optional="no">
+ <cd:parameter name="spacefactor">
+ <!-- Can’t inherit from “\setupcharacterkerning” because cont-en.xml
+ still lacks that entry. -->
+ <cd:constant type="cd:number" default=".125"/>
+ </cd:parameter>
+ <cd:parameter name="spaceskip">
+ <cd:constant type="cd:dimension" default=".33em"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="defineletterspace" file="t-letterspace.tex">
+ <cd:sequence>
+ <cd:string value="defineletterspace"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords n="1" optional="no">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:assignments n="2" list="yes" optional="yes">
+ <cd:inherit name="setupletterspace" n="2"/>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="letterspace" generated="yes" file="t-letterspace.mkiv">
+ <cd:sequence>
+ <cd:variable value="letterspace"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:assignments n="1" list="yes" optional="yes">
+ <cd:inherit name="setupletterspace"/>
+ </cd:assignments>
+ <cd:content n="2" optional="yes"/>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="letterspace" generated="yes" type="environment" file="t-letterspace.mkiv">
+ <cd:sequence>
+ <cd:variable value="letterspace"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:assignments n="1" list="yes" optional="yes">
+ <cd:inherit name="setupletterspace"/>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+
+</cd:interface>