From 4bdd69ead9512d0200c4e2481c1b7980c9ab9c20 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Fri, 30 Aug 2019 01:55:44 +0200 Subject: [PATCH] further workarounds for font issues --- beamerfontthemetud.sty | 260 +++++++++++++++++++++++++++++++++++++++++ shell.nix | 4 + talk-slides.tex | 37 +++++- 3 files changed, 295 insertions(+), 6 deletions(-) create mode 100644 beamerfontthemetud.sty diff --git a/beamerfontthemetud.sty b/beamerfontthemetud.sty new file mode 100644 index 0000000..6f58471 --- /dev/null +++ b/beamerfontthemetud.sty @@ -0,0 +1,260 @@ +\ProvidesPackage{beamerfontthemetud}[2011/01/17 v1 TU Dresden font theme for Beamer class] + +\RequirePackage{ifluatex} + +\newif\if@check@tud@fonts +\@check@tud@fontstrue + +\newif\if@noDIN\@noDINfalse +\newif\if@sansmath\@sansmathtrue +\newif\if@useHeavyFont\@useHeavyFontfalse +\newif\if@useBeamerFont\@useBeamerFontfalse +\newif\if@useUniversFont\@useUniversFontfalse + +\def\tudbeamer@font@style{cd2018} +\DeclareOptionBeamer{cd2018}{% + \edef\tudbeamer@font@style{cd2018}% +} +\DeclareOptionBeamer{cd2012ts}{% + \edef\tudbeamer@font@style{cd2012ts}% + \@useUniversFonttrue +} + + +\providecommand\tudfontspackage{tudscrfonts} +\def\check@tud@fonts@tudscrfonts{ + \@check@tud@fontsfalse + \@for\@tudfontfile:=% + tudscrfonts.sty,% + 8r0m6.fd,% + 8rlun.fd,% + oml0m6.fd,% + omllun.fd,% + oms0m6.fd,% + omslun.fd,% + ot10m6.fd,% + ot1lun.fd,% + ot1lunt.fd,% + t10m6.fd,% + t1lun.fd,% + t1lunt.fd,% + ts10m6.fd,% + ts1lun.fd,% + ts1lunt.fd% + \do{% + \IfFileExists{\@tudfontfile}{}{\@check@tud@fontstrue}% + } + \if@check@tud@fonts + \def\tudfontspackage{tudfonts}% + \check@tud@fonts@tudfonts% + \fi +} + +\def\check@tud@fonts@tudfonts{% + \@check@tud@fontsfalse + \@for\@tudfontfile:=% + tudfonts.sty,% + 8raub.fd,% + 8raun.fd,% + 8rdin.fd,% + ot1aub.fd,% + ot1aun.fd,% + ot1din.fd,% + t1aub.fd,% + t1aun.fd,% + t1din.fd,% + ts1aub.fd,% + ts1aun.fd,% + ts1din.fd% + \do{% + \IfFileExists{\@tudfontfile}{}{% + \def\tudfontspackage{}% + \@useUniversFontfalse + } + } +} + +\DeclareOptionBeamer{beamerfont}{\@useBeamerFonttrue} +\DeclareOptionBeamer{cp2012ts}{ + \@useUniversFonttrue +} +\if@useBeamerFont +\else + \csname check@tud@fonts@\tudfontspackage \endcsname +\fi + + + +\DeclareOptionBeamer{noeulermath}{\PassOptionsToPackage{noeulermath}{tudfonts}} + +\DeclareOptionBeamer{noDIN}{ + \@noDINtrue + \PassOptionsToPackage{noDIN}{\tudfontspackage} +} + +\DeclareOptionBeamer{nodin}{ + \@noDINtrue + \PassOptionsToPackage{noDIN}{\tudfontspackage} + \PackageWarning{beamerfontthemetud}{Option `nodin' is obsolete use `noDIN', please!} +} + + +\DeclareOptionBeamer{serifmath}{% + \@sansmathfalse + \PassOptionsToPackage{serifmath}{\tudfontspackage} +} + +\DeclareOptionBeamer{heavyfont}{\PassOptionsToPackage{heavyfont}{\tudfontspackage}} + +\ProcessOptionsBeamer + +\if@sansmath +\else + \usefonttheme[onlymath]{serif} +\fi + +\def\tud@font@setup@beamer@tudfonts{} +\def\tud@font@setup@beamer@tudscrfonts{% + \def\dinfamily{\dinbn}% + \let\dinBold\dinfamily% +} +\AtBeginDocument{% + \providecommand*\dinfamily{% + \PackageWarning{beamerfontthemetud}{% + Neither package `tudscrfonts' nor `tudfonts' was loaded!% + }% + }% + \providecommand*\dinBold{\dinfamily}% +} + +\if@useBeamerFont +\else +\if@useUniversFont + \RequirePackage{\tudfontspackage} + \csname tud@font@setup@beamer@\tudfontspackage \endcsname +\else + \@noDINtrue + \ifluatex + % Load fontspec and define a document font: + \usefonttheme{professionalfonts} + \usepackage{fontspec} + \setmainfont{TeX Gyre Pagella} + + \RequirePackage{unicode-math} + \IfFontExistsTF{Open Sans}{% + \PackageInfo{Beamer Font Theme TUD}{Using default Open Sans font} + \setmathfont{XITS Math} + \setmainfont{Open Sans} + \setsansfont{Open Sans} +% \setmathfont{texgyrepagella-math.otf} + % \setmathfont{OpenSans} + % \setmathfont[math-style=TeX]{Latin Modern Math} + % \setmathfont{Asana Math}% + % \setmathfont[range=\mathbfsfit/{greek,Greek,latin,Latin}]{Open Sans} + % up , it , tt , bfup , bfit , bb , bbit , scr , bfscr , cal , bfcal , + % frak , bffrak , sfup , sfit , bfsfup , bfsfit , bfsf + \setmathfont[range={up}]{Open Sans} + \setmathfont[range={it}]{Open Sans} + \setmathfont[range={bfup}]{Open Sans} + \setmathfont[range={bfit}]{Open Sans} + \setmathfont[range={sfup}]{Open Sans} + \setmathfont[range={sfit}]{Open Sans} + \setmathfont[range={bfsfup}]{Open Sans} + \setmathfont[range={bfsfit}]{Open Sans} + %\setmathfont[range=\mathfrak]{STIX Math} + \setmathfont[range=\mathfrak]{XITS Math} + %\setmathfont{Open Sans} + %\renewcommand*\setminus{\mathbin{\mathsf{\backslash}}} + % \setmonofont{Open Sans} + % \setmathsf{Open Sans} + % \setmathrm{Open Sans} + % \setmathtt{Open Sans} + % \setboldmathrm{Open Sans} + %\setmathfont{Asana Math} + }{% + \PackageError{Beamer Font Theme TUD}{^^J% + Die Schrift ,,Open Sans'' konnte nicht gefunden werden.^^J% + Could not load Open Sans font.% + }{% + Das bedeutet meist, dass Sie die Fonts von der TU Dresden^^J% + herunterladen und in Ihrem Fontverzeichnis installieren müssen.^^J% + Alternativ können Sie auch das entsprechende Schriftpacket (opensans)^^J% + Ihrer TeX-Distribution oder Ihres Betriebssystems installieren.^^J% + ^^J% + Please install Open Sans for your Operating system.^^J% + This usually means that you have to download the Open Sans Package^^J% + from the TU Dresden homepage.^^J% + Alternatively, you could install the corresponding font package^^J% + (opensans) for your TeX distribution or your operating system.^^J% + }% + } + \else + \RequirePackage[default]{opensans} + \fi +\fi +\fi + +\def\tudfonts@defstyle#1{% + \expandafter\def\csname tudbeamer@font@style@#1\endcsname +} + +\def\tudfontsloadstyle#1{ + \csname tudbeamer@font@style@#1\endcsname +} +\tudfonts@defstyle{cd2012ts}{% + \newcommand*\tudtitlenormalsize{\@setfontsize\tudtitlenormalsize\@xipt{13.6}} + \newcommand*\tudtitlesmall{\@setfontsize\tudtitlesmall\@xpt\@xiipt} + \newcommand*\tudtitletiny{\@setfontsize\tudtitletiny\@vipt\@viipt} + \newcommand*\tudtitleLARGE{\@setfontsize\LARGE\@xviipt{22}} + \newcommand*\tudfoottiny{\@setfontsize\tudfoottiny% + {.347309973197\tudbeamerlogoheight}% + {.347309973197\tudbeamerlogoheight}% + } + \setbeamerfont{einrichtung/titlepage}{size=\tudtitletiny,series=\bfseries} + \setbeamerfont{fachrichtung/titlepage}{size=\tudtitletiny} + \setbeamerfont{institut/titlepage}{parent=fachrichtung/titlepage} + \setbeamerfont{professur/titlepage}{parent=fachrichtung/titlepage} + \setbeamerfont{date in head/foot/titlepage}{size=\tudtitlenormalsize} + \setbeamerfont{author/titlepage}{size=\tudtitlesmall} + \setbeamerfont{subtitle}{series=\bfseries,family=\sffamily} + \setbeamerfont{frametitle}{size=\normalsize,family=\sffamily} + \setbeamerfont{framesubtitle}{size=\small,series=\bfseries,family=\sffamily} +} +\tudfonts@defstyle{cd2018}{% + \newcommand*\tudtitlenormalsize{\@setfontsize\tudtitlenormalsize{0.02963\paperheight}{0.02963\paperheight}} + \newcommand*\tudtitleLARGE{\@setfontsize\tudtitleLARGE{0.059259\paperheight}{0.059259\paperheight}} + \newcommand*\tudtitlesmall{\@setfontsize\tudtitlesmall{.0246916\paperheight}{.0046916\paperheight}} + \newcommand*\tudtitletiny{\@setfontsize\tudtitletiny{.02057638\paperheight}{.02057638\paperheight}} + \newcommand*\tudfoottiny{\@setfontsize\tudfoottiny% + {.347309973197\tudbeamerlogoheight}% + {.347309973197\tudbeamerlogoheight}% + } + \setbeamerfont{author/titlepage}{size=\tudtitlenormalsize,series=\mdseries,family=\sffamily} + \setbeamerfont{einrichtung/titlepage}{parent=author/titlepage} + \setbeamerfont{fachrichtung/titlepage}{parent=einrichtung/titlepage} + \setbeamerfont{institut/titlepage}{parent=fachrichtung/titlepage} + \setbeamerfont{professur/titlepage}{parent=fachrichtung/titlepage} + \setbeamerfont{date in head/foot/titlepage}{size=\tudtitlenormalsize,family=\sffamily} + \setbeamerfont{subtitle}{size=\tudtitlenormalsize,series=\mdseries,family=\sffamily} + \setbeamerfont{frametitle}{size=\LARGE,family=\sffamily,series=\bfseries} + \setbeamerfont{framesubtitle}{size=\LARGE,family=\sffamily,series=\mdseries} +} + +\tudfontsloadstyle{\tudbeamer@font@style} + +%\setbeamerfont{itemize/enumerate subbody}{size=\scriptsize} +%\setbeamerfont{itemize/enumerate subsubbody}{size=\scriptsize} +\setbeamerfont{description item}{parent=item,series=\bfseries} +\setbeamerfont{section in head/foot}{size=\normalsize,family=\sffamily} +\setbeamerfont{footline}{size=\tudfoottiny} +\setbeamerfont{page number in footline}{size=\tudfoottiny} +\setbeamerfont{title in head/foot}{family=\sffamily} +\setbeamerfont{block title}{size={}} +\setbeamerfont{part page/title}{parent=title} +\setbeamerfont{part page/subtitle}{parent=part page/title,series=\mdseries} + +\if@noDIN + \setbeamerfont{title}{size=\tudtitleLARGE,series=\bfseries,family=\sffamily} +\else + \setbeamerfont{title}{size=\tudtitleLARGE,series=\bfseries,family=\dinfamily} +\fi diff --git a/shell.nix b/shell.nix index 0b812de..90f1f17 100644 --- a/shell.nix +++ b/shell.nix @@ -41,6 +41,7 @@ mkShell { opensans-ttf xits-math stix-otf + fontconfig # for instance DNS query script (python3.withPackages (ps: with ps; [ @@ -60,4 +61,7 @@ mkShell { git-lfs (sqlite.override {interactive=true;}) ]; + + # for font discovery + FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ lmodern opensans-ttf xits-math stix-otf ]; }; } diff --git a/talk-slides.tex b/talk-slides.tex index 3dbd16e..9c61fb8 100644 --- a/talk-slides.tex +++ b/talk-slides.tex @@ -49,11 +49,13 @@ \ifluatex \usepackage{fontspec} -\setmainfont{TeX Gyre Pagella} -\RequirePackage{unicode-math} - \setmathfont{XITS Math} - \setmainfont{Open Sans} - \setsansfont{Open Sans} +%\setmainfont{TeX Gyre Pagella} +%\RequirePackage{unicode-math} + %\setmathfont{XITS Math} + %\setmainfont{Open Sans} + %\setsansfont{Open Sans} + %\setmathfont[range={it}]{Open Sans:style=Italic} + %\setmathfont[range={it}]{Open Sans} \else \usepackage[T1]{fontenc} @@ -258,6 +260,7 @@ Hashtags are used for marking posts about certain topics or events: \only<1>{\item subscription to \texttt{@alice@cyber.space} by contacting instance \texttt{cyber.space}} \only<2>{\item all future posts by alice are delivered to instances of subscribers, but \textit{not} instances without any subscriber} + \only<3>{\item other ways for posts to reach an instance:\\ boosts, thread resolution} \end{itemize} \end{column} \end{columns} @@ -265,7 +268,19 @@ Hashtags are used for marking posts about certain topics or events: \begin{frame}{Current Solutions} \begin{itemize} - \item Mastodon PubRelay: centralised relay + \item Mastodon PubRelay or Pleroma lite-pub relay: + \begin{itemize} + \item centralised actor relaying all incoming posts + \item single point of failure, which relay to choose? + \item relaying all incoming posts \(\Rightarrow\) huge load on small instances + \item only access to posts sent after initial subscribtion + \end{itemize} + \item Diaspora* SocialRelay + \begin{itemize} + \item similar, but allows subscribing to certain tags only + \end{itemize} + + \end{itemize} \end{frame} @@ -275,8 +290,18 @@ Hashtags are used for marking posts about certain topics or events: \section{System Architecture} +\begin{frame}{System Architecture}{Goals} +\begin{itemize} + \item \textbf{relay \& subscribe}: instances can subscribe to all public posts of a hashtag + \item \textbf{store \& query}: instances can retrieve 1 year of history for a hashtag without subscription + \item fully decentralised, no single point of authority for all tags +\end{itemize} +\end{frame} + \begin{frame}{System Architecture}{adding a P2P backend to the fediverse} +core idea: distributing responsibility for tags using a \textbf{D}istributed \textbf{H}ash \textbf{T}able \note{distribute responsibility for posts of a hashtag = relaying \& storage} + \end{frame} why even still use classic push federation?