summaryrefslogtreecommitdiffstats
path: root/term_ps.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove a bunch of useless assignments,Ingo Schwarze2011-10-161-3/+2
| | | | | | | and assert that print_bvspace cannot be called on NULL pointers. No change in behaviour, none of these were bugs, but the code becomes easier to understand. Based on a clang report posted by joerg@; ok kristaps@.
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-1/+1
| | | | found while syncing to OpenBSD
* Fixed mingw compatibility where the "z" printf() modifier isn'tKristaps Dzonsons2011-08-161-4/+5
| | | | | recognised. It's easier to make these u_int than to jump through hoops for a special formatter.
* Add mode for -Tlocale. This mode, with this commit, behaves exactlyKristaps Dzonsons2011-05-171-1/+2
| | | | | | | like -Tascii. While adding this, inline term_alloc() (was a one-liner), remove some switches around the terminal encoding for the symbol table (unnecessary), and split out ascii_alloc() into ascii_init(), which is also called from locale_init().
* Move struct termp_ps into term_ps.c; remove the engine union in struct termp,Kristaps Dzonsons2011-05-151-168/+196
| | | | | | which only held one entry; finally (as per the first), make "ps" member into a pointer managed by term_ps.c. This frees up a nice chunk of memory during run-time and in the binary.
* Make character engine (-Tascii, -Tpdf, -Tps) ready for Unicode: make bufferKristaps Dzonsons2011-05-141-6/+9
| | | | | | consist of type "int". This will take more work (especially in encode and friends), but this is a strong start. This commit also consists of some harmless lint fixes.
* Move mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.hKristaps Dzonsons2011-03-171-6/+1
| | | | | | | | so that everybody can use them. This follows the convention of libXXXX.h being internal to a library and XXXX.h being the external interface. Not only does this allow the removal of lots of redundant NULL-checking code, it also sets the tone for adding new mandoc-global routines.
* Do not leak information about the software usedIngo Schwarze2011-03-071-2/+0
| | | | | | | | | into PostScript and PDF documents behind the user's back. Joerg Sonnenberger pointed out that almost all software creating PostScript and PDF documents does so, even on OpenBSD, but that doesn't make the leakage much better in my book. According to all standards i could find, this information is optional. Issue originally reported by deraadt@; "commit!" kristaps@.
* Remove unnecessary conditional...Kristaps Dzonsons2011-01-251-2/+1
|
* Merge from OpenBSD right after 1.10.6; now back to full sync.Ingo Schwarze2010-09-271-1/+1
| | | | | | | | | | * mdoc.c: blank lines outside literal mode are more similar to .sp than .Pp * backslashes do not terminate macros; partial revert of mdoc.c 1.164; the intention of that commit is fully achieved in roff.c * mdoc_term.c: no need to list the same prototype twice * mdoc_validate.c: drop .Pp before .sp just like .Pp before .Pp * fix off-by-one found by jsg@ with parfait, OpenBSD term_ps.c 1.12 ok kristaps@
* Churny commit to quiet lint. No functional changes.Kristaps Dzonsons2010-09-041-2/+3
|
* "sys/param.h is for kernel interface programs.Kristaps Dzonsons2010-08-261-1/+1
| | | | | | sys/types.h is the file you want to include." From a downstream fix by deraadt@.
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-2/+3
| | | | | | | | | | | | | | | | | We now have sufficient practical experience to know what we want, so this is intended to be final: - provide -Wlevel (warning, error or fatal) to select what you care about - provide -Wstop to stop after parsing a file with warnings you care about - provide consistent exit status codes for those warnings you care about - fully document what warnings, errors and fatal errors mean - remove all other cruft from the user interface, less is more: - remove all -f knobs along with the whole -f option - remove the old -Werror because calling warnings "fatal" is silly - always finish parsing each file, unless fatal errors prevent that This commit also includes a couple of related simplifications behind the scenes regarding error handling. Feedback and OK kristaps@; Joerg Sonnenberger (NetBSD) and Sascha Wildner (DragonFly BSD) agree with the general direction.
* IMPORTANT FIX: add missing braces around alloc failure conditional inKristaps Dzonsons2010-08-061-3/+7
| | | | | fuction-isation of PS_GROWBUF. Obviously the original commit was never actually tested, as -Tps and -Tpdf errored out immediately.
* Turn the non-trivial PS_GROWBUF macro into a function. Don't use MAX, itJoerg Sonnenberger2010-08-011-15/+18
| | | | doesn't exist in the default namespace on Solaris.
* Fully-working -Tpdf: xref table is now generated. This works for bothKristaps Dzonsons2010-07-251-14/+43
| | | | single and multiple-manual mode (e.g., mandoc -Tpdf foo.1 bar.1).
* Make PDF sections contiguous.Kristaps Dzonsons2010-07-251-63/+51
|
* Initial PDF shim over PS. This produces working PDF output with -Tpdf.Kristaps Dzonsons2010-07-251-46/+226
| | | | | | | | | | It's currently missing the xref table, so you'll get a warning in most PDF viewers). It also produces lots of redundant output, which will go away once I get a better handle on the PDF spec. The code doesn't really touch any existing functionality; it's a bunch of conditionals atop the -Tps (term_ps.c) implementation. I'm checking it in now to have it exist and be auditable. It needs clean-up, polish, and general care (and xref!).
* The "wx" value is quite small, so use a u_short instead of a size_t.Kristaps Dzonsons2010-07-211-7/+7
|
* Use floating-point -Tps "moveto" arguments to smooth out column and rowKristaps Dzonsons2010-07-201-4/+4
| | | | misalignments.
* correct lots of copyright notices;Ingo Schwarze2010-07-131-1/+1
| | | | ok kristaps@
* Suppress duplicate "Page: 1 1" -Tps printing and instead relay onKristaps Dzonsons2010-07-051-5/+1
| | | | PS_NEWPAGE to do the job for us. Noted by Dillo.
* gv(1) doesn't remember the last set font when displaying new pages, soKristaps Dzonsons2010-07-041-6/+24
| | | | | print it out for each new page. This also prevents superfluous printings of the font before the %%Page: comment has been displayed.
* Set line-height to be 1.4em. Removed check for minimum margins that are noKristaps Dzonsons2010-07-041-18/+5
| | | | longer important.
* Suppress printing blank eof pages in -Tps. Delay printing of Page:Kristaps Dzonsons2010-07-041-9/+13
| | | | until actual text is ready to be displayed.
* Suppress printing of newlines/space at start of new -Tps page.Kristaps Dzonsons2010-07-041-15/+31
| | | | | Also renamed "psstate" -> "flags" (was wrongly implying some sort of state machine).
* Backed out margin calculations in favour of much simpler rule of thumb:Kristaps Dzonsons2010-07-041-15/+10
| | | | margins are 1/9 the length/width.
* Auto-margins. Documented in mandoc.1. Also bumped line-height and madeKristaps Dzonsons2010-07-041-12/+39
| | | | sure header and footer accomodate for said line-height.
* Lint fixes.Kristaps Dzonsons2010-07-021-0/+1
|
* First, I'm defaulting to 11-point font, which renders much nicer (theKristaps Dzonsons2010-07-011-14/+40
| | | | | | | | | | | "Internet" vaguely suggests using 11- or 9-Point for serifed fonts). This verified on GNU/Linux, Mac OSX, Windows, and OpenBSD. Noted in mandoc.1. Then added a3, a4, a5, letter, legal, and custom page dimensions. These seem to be the main players. Noted in mandoc.1. Lintified the casting.
* Now using Times AFM provided by Dillo. Verified on OpenBSD by me and Mac OSXKristaps Dzonsons2010-06-301-270/+270
| | | | by M. Deksters.
* Correct dimensions for DocumentMedia. Noted by schwarze@, as gv(1) wasKristaps Dzonsons2010-06-301-5/+4
| | | | puking on input.
* Embedding Charter proportional-width glyphs. Nice-looking output.Kristaps Dzonsons2010-06-301-288/+288
|
* PostScript can now handle scaled glyph sizes (see "scale" in structKristaps Dzonsons2010-06-301-17/+27
| | | | termp_ps) to arbitrarily scale font. Tested with 10 (default), 12, 14.
* Pushed normalisation of scaling units into term_hspan().Kristaps Dzonsons2010-06-301-9/+3
|
* Move term_hspan() calculation into the output devices, where it belongs.Kristaps Dzonsons2010-06-301-6/+65
|
* Push paper calculation out of getsubopt() loop. Make all points be AFMKristaps Dzonsons2010-06-301-20/+21
| | | | glyph units to make positioning more precise.
* Add in -Opaper=xxx support for -Tps postscript. This doesn't have anyKristaps Dzonsons2010-06-291-1/+23
| | | | | | functional changes beyond the getsubopt() parse in term_ps.c. If you want to test this (it only does -Opaper=a4 and -Opaper=letter; adding more is trivial), make sure you specify (e.g.) -sPAPERSIZE=a4 to gs(1).
* Give -Tps better PostScript hinting. Note that we're using Adobe-3.0Kristaps Dzonsons2010-06-291-23/+56
| | | | | constructs. Push the stupid CPP defines for page boundaries and margins into proper variables. Give enum termfont a proper TERMFONT__MAX.
* Clean-up of variable-width glyph support. Adds no new code; onlyKristaps Dzonsons2010-06-281-9/+11
| | | | | restructured to make a bit more readable. Also removed an unused entry in the PS engine structure.
* This enables variable glyph-width output. The checkin will be followedKristaps Dzonsons2010-06-281-15/+13
| | | | | | by a [functionless] clean-up in term_ps.c, but this makes the appropriate changes to "enable" initial proportional-width functionality in term.c and fixes some areas of term_ps.c that were causing errors.
* Initial encoding of glyph widths. From /usr/X11R6/lib/X11/fonts/Type1.Kristaps Dzonsons2010-06-281-14/+341
| | | | These continues proportional-width glyph encoding.
* Remove "pt" from struct roffsu, as CSS (the only reason it was there) isKristaps Dzonsons2010-06-251-0/+1
| | | | | unclear about which units accept floats/integers, which leads me to assume that it handles either and rounds as appropriate.
* Initial chunks for variable-width fonts. Pushes all width calculationsKristaps Dzonsons2010-06-251-0/+12
| | | | | | | | in mdoc_term.c and man_term.c down into term.c. This is still not implemented in term.c, although stubs for width calculations are in place. From now on, offset, rmargin, and other layout variables are abstract screen widths. They will resolve to the the familiar values for -Tascii but -Tps will eventually use points instead of chars.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Implement font-switching for PostScript. -Tps now supportsKristaps Dzonsons2010-06-111-61/+133
| | | | | | TERMFONT_BOLD (Courier-Bold) and TERMFONT_UNDER (Courier-Oblique). It doesn't look half bad. This accomplished through tricksy juggling of the one-char back-buffer.
* Delay opening a word state until a character is ready to be output.Kristaps Dzonsons2010-06-111-20/+41
| | | | | This paves the way for closing/reopening scope in the event that a font changes.
* Teach -Tps to ignore backspace-encoding by using a one-char buffer and aKristaps Dzonsons2010-06-111-1/+30
| | | | simple state machine. This paves the way for decorated text.
* Allow open word contexts in -Tps to preserve whitespace, as whitespaceKristaps Dzonsons2010-06-101-3/+4
| | | | | apparently doesn't collapse in PostScript (surprise!). Makes output files much more compact.
* Forgot to increment into the nil terminator. And call va_end() whileKristaps Dzonsons2010-06-091-1/+3
| | | | we're at it.