rtf

Does \pard mean to reset the font?


I'm new to RTF, looking at this: https://www.oreilly.com/library/view/rtf-pocket-guide/9781449302047/ch01.html

"\pard means to reset the paragraph-formatting attributes to their default value, instead of inheriting them (or some of them!) from the previous paragraph. "

{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial Black;}{\f1\fswiss\fprq2\fcharset0 Calibri;}{\f2\fswiss\fprq2\fcharset0 Tahoma;}{\f3\fnil\fcharset0 Arial;}}{\colortbl ;\red0\green0\blue0;\red0\green63\blue89;\red255\green0\blue0;\red0\green123\blue255;\red0\green0\blue255;}\viewkind4\uc1
\pard\li-284\sa160\sl252\slmult1\cf1\lang2057\f0\fs36 Hello world\cf2\f1\fs21 
\par 
\par The last font was caliibri
\par
\pard \f2 This should now be Tahoma
\par 
\pard Doesnt pard mean reset?
\par \f1 Calibria again
\par }

So here shouldn't the line that says "Doesnt pard mean reset" be in Arial black because of the deff0?

(Edit) I'm now thinking that pard means to reset back to the previously pard, rather than globally


Solution

  • The \pard token resets paragraph formatting.

    Font however is part of the character formatting, therefore it is not affected by \pard.

    (the RTF token which resets character formatting is \plain).


    Note: answer edited