Sponsored Content
Top Forums Shell Programming and Scripting Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9" Post 303028802 by jcdole on Tuesday 15th of January 2019 10:00:59 AM
Old 01-15-2019
Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello.

System : opensuse leap 42.3


I have a bash script that build a text file.
I would like the last command doing :
Code:
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt

where :

Code:
 print_cmd ::= some printing command


Code:
-o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 ::= margin definition options
 
-o font=LatinModernMono12:regular:9 ::= 'font name : font style : font size' font definition options

some_file.txt ::= the file to print


I want to use any standard installed fonts.


I had a look to enscript and groff but I don't understand how to install the font I want to use to their environment.


Any help is welcome

Last edited by Neo; 01-15-2019 at 12:49 PM.. Reason: formatting... code tags.. all the basic stuff.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. Shell Programming and Scripting

Simplify Bash Script Using "sed" Or "awk"

Input file: 2 aux003.net3.com error12 6 awn0117.net1.com error13 84 aux008 error14 29 aux001.ha.ux.isd.com error12 209 aux002.vm.ux.isd.com error34 21 alx0027.vm.net2.com error12 227 dux001.net5.com error123 22 us008.dot.net2.com error121 13 us009.net2.com error129Expected Output: 2... (4 Replies)
Discussion started by: sQew
4 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

6. Shell Programming and Scripting

Substituting comma "," for dot "." in a specific column when comma"," is a delimiter

Hi, I'm dealing with an issue and losing a lot of hours figuring out how i would solve this. I have an input file which looks like this: ('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos') ('BLABLA +200-GRR','Serviço... (6 Replies)
Discussion started by: poliver
6 Replies

7. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
HPFTODIT(1)						      General Commands Manual						       HPFTODIT(1)

NAME
hpftodit - create font description files for use with groff -Tlj4 SYNOPSIS
hpftodit [ -sv ] [ -in ] tfm_file map_file font It is possible to have whitespace between the -i command line option and its parameter. DESCRIPTION
hpftodit creates a font file for use with groff -Tlj4 from an HP tagged font metric file. tfm_file is the name of the tagged font metric file for the font. map_file is a file giving the groff names for characters in the font; this file should consist of a sequence of lines of the form: n c1 c2 ... where n is a decimal integer giving the MSL number of the character, and c1, c2,... are the groff names of the character. font is the name of the groff font file. The groff font file is written to font. The -s option should be given if the font is special (a font is special if troff should search it whenever a character is not found in the current font.) If the font is special, it should be listed in the fonts command in the DESC file; if it is not special, there is no need to list it, since troff can automatically mount it when it's first used. If the -i option is used, hpftodit will automatically generate an italic correction, a left italic correction and a subscript correction for each character (the significance of these parameters is explained in groff_font(5)). OPTIONS
-v Print the version number. -s The font is special. The effect of this option is to add the special command to the font file. -in Generate an italic correction for each character so that the character's width plus the character's italic correction is equal to n design units plus the amount by which the right edge of the character's bounding is to the right of the character's origin. If this would result in a negative italic correction, use a zero italic correction instead. There are 8782 design units per em for Intelli- font fonts. Also generate a subscript correction equal to the product of the tangent of the slant of the font and four fifths of the x-height of the font. If this would result in a subscript correction greater than the italic correction, use a subscript correction equal to the italic correction instead. Also generate a left italic correction for each character equal to n design units plus the amount by which the left edge of the character's bounding box is to the left of the character's origin. The left italic correction may be negative. This option is normally needed only with italic (or oblique) fonts. FILES
/usr/share/groff/1.18.1/font/devlj4/DESC Device description file. /usr/share/groff/1.18.1/font/devlj4/F Font description file for font F. BUGS
This program was written without the benefit of complete, official documentation on the tagged font metric format. It is therefore likely that it will fail to work on tfm files that are dissimilar to those for the internal fonts on the Laserjet 4, with which it was tested: TrueType tfm files are not supported. SEE ALSO
groff(1), grolj4(1), groff_font(5) Groff Version 1.18.1 27 June 2001 HPFTODIT(1)
All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy