Skip to content

Commit

Permalink
Sentence-based line breaks for Text-annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Sep 29, 2023
1 parent a430496 commit 7008f38
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1065,46 +1065,37 @@ \subsubsection{Text}\label{text}
\item
\%\% replaced by \%
\item
\%name replaced by the name of the component (i.e., the identifier for
it in the enclosing class).
\%name replaced by the name of the component (i.e., the identifier for it in the enclosing class).
\item
\%class replaced by the name of the class (only the last part of the hierarchical name).
\item
\%\emph{par} and \%\{\emph{par\}} replaced by the value of the
parameter \lstinline!par!.
\%\emph{par} and \%\{\emph{par\}} replaced by the value of the parameter \lstinline!par!.
If the value is numeric, tools shall display the value with \lstinline!displayUnit!, formatted according to bipm-specification.
E.g., for
\begin{lstlisting}[language=modelica]
parameter Real t(unit = "s", displayUnit = "ms") = 0.1
\end{lstlisting}
tools shall display \emph{100 ms}.
The intent is that the text is easily readable,
thus if \lstinline!par! is of an enumeration type, replace \lstinline!%par! by the item name,
not by the full name.
The intent is that the text is easily readable, thus if \lstinline!par! is of an enumeration type, replace \lstinline!%par! by the item name, not by the full name.
\begin{example}
If \lstinline!par = "Modelica.Blocks.Types.Enumeration.Periodic"!, then \lstinline!%par! should be displayed as \emph{Periodic}.
\end{example}
The form \%\{\emph{par\}} allows component-references and is required for quoted identifiers, and can be directly
followed by a letter. Thus \lstinline!%{w}x%{h}! gives the value of \lstinline!w!
directly followed by \emph{x} and the value of \lstinline!h!, while \lstinline!%wxh! gives the value of the
parameter \lstinline!wxh!. If the parameter does not exist it is an error.
The form \%\{\emph{par\}} allows component-references and is required for quoted identifiers, and can be directly followed by a letter.
Thus \lstinline!%{w}x%{h}! gives the value of \lstinline!w! directly followed by \emph{x} and the value of \lstinline!h!, while \lstinline!%wxh! gives the value of the parameter \lstinline!wxh!.
If the parameter does not exist it is an error.
\end{itemize}

The style attribute \lstinline!fontSize! specifies the font size. If the \lstinline!fontSize!
attribute is 0 the text is scaled to fit its extent. Otherwise, the size
specifies the absolute size. The text is vertically centered in the extent.
The style attribute \lstinline!fontSize! specifies the font size. If the \lstinline!fontSize! attribute is 0 the text is scaled to fit its extent. Otherwise, the size specifies the absolute size. The text is vertically centered in the extent.

If the \lstinline!extent! specifies a box with zero width and positive height the
height is used as height for the text (unless \lstinline!fontSize! attribute is
non-zero -- which specifies the absolute size), and the text is not
truncated (the \lstinline!horizontalAlignment! is still used in this case).
If the \lstinline!extent! specifies a box with zero width and positive height the height is used as height for the text (unless \lstinline!fontSize! attribute is non-zero -- which specifies the absolute size), and the text is not truncated (the \lstinline!horizontalAlignment! is still used in this case).

\begin{nonnormative}
A zero-width \lstinline!extent! is convenient for handling texts where the width is unknown.
\end{nonnormative}

If the string \lstinline!fontName! is empty, the tool may choose a font. The font names \lstinline!"serif"!, \lstinline!"sans-serif"!, and \lstinline!"monospace"! shall be recognized. If possible
the correct font should be used -- otherwise a reasonable match, or treat as if \lstinline!fontName! was empty.
If the string \lstinline!fontName! is empty, the tool may choose a font.
The font names \lstinline!"serif"!, \lstinline!"sans-serif"!, and \lstinline!"monospace"! shall be recognized.
If possible the correct font should be used -- otherwise a reasonable match, or treat as if \lstinline!fontName! was empty.

The style attribute \lstinline!textStyle! specifies variations of the font.

Expand Down

0 comments on commit 7008f38

Please sign in to comment.