Font substitution configuration file

Good morning. 
Looking for some information or guidance on the Font Substitution Configuration file that is optionally browsable in the Optimize node.
The documentation simply states the following:
Font Substitution Configuration File: Defines the pdfToolbox configuration file that will be used when embedding fonts. This configuration file controls font substitution behavior in Optimize. Fonts are embedded as subsets. Fonts are not embedded if they have a flag indicating that embedding is not allowed.
What does this function allow me to do, and is there a sample availabe that I can see how it is configured? 
Is it necessary to use the "Embed Fonts if Needed" in the optimize setup?
Chris
 

I added a new topic to the forum covering font substitution: http://forum.support.xerox.com/t5/FreeFlow-Core/Font-substitution-when-Embedding-fonts/td-p/177411

Similar Messages

  • Font substitution when Embedding fonts

    The font embedding controls in FFCore's Optimize component include the ability to upload and select a Font Substitution Configuration File: To recap the documentation:The Font Substitution Configuration File option defines the pdfToolbox configuration file that will be used when embedding fonts.This configuration file controls font substitution behavior in Optimize. Fonts are embedded as subsets. Fonts are not embedded if they have a flag indicating that embedding is not allowed. The Embed missing fonts fixup in pdfToolbox Desktop preflight profiles includes an option to select a Font substitution policy:   If you select the Open folder with configuration files you will see the text files that control font substitution. Although pdfToolbox Desktop comes with 3 predefined font substitution policies, additional ones can be created by duplicating an existing policy file and editing it (you will have to restart acrobat to see the changes).  The prefix on the filname controls the display order of the font policies within pdfToolbox. I would also ensure there are no spaces in any new filenames. The font substitution policies are plain text files with the following content: DisplayName 1 My Special Name SubstituteAll<tab>Arial<tab>Helvetica<tab>Helvetica Neue<tab>Futura<tab>Helvetica Neue<tab>Microsoft Sans Serif<tab>MS PGothic<tab>Trebuchet MS<tab>Verdana
    SubstituteFirst<tab>Arial Bold<tab>Arial-Bold<tab>Helvetica Bold<tab>Futura-Bold<tab>Futura Bold<tab>Helvetica-Bold
     The DisplayName defines the name that will appear in the pdfToolbox UI: The remaining lines specify which fonts may be substituted by which fonts and the precedence for substitution.SubstituteAll - all fonts in the list are substituted for each other. When a font is missing pdfToolbox will work down the list until it reaches the name of an available font.SubstituteFirst - only the first font in the list is substituted. pdfToolbox will work down the list until it reaches the name of an available font. Note: the font names must match what pdfToolbox will find. The best way to ascertain that is to run a preflight on the file and copy the names off the report.  UPDATE - Updated example text to show location of tabs

    I added a new topic to the forum covering font substitution: http://forum.support.xerox.com/t5/FreeFlow-Core/Font-substitution-when-Embedding-fonts/td-p/177411

  • Font substitution issues when creating PDF from PS file in Distiller

    I am not sure if this post should go under Distiller Server, but it dont know if there is a difference between Distiller X and Distiller Server.
    Context: I am trying to convert postscript files on my PC that originate from a unique Mac built program and unfortunately receive the following error message:
    %%[ Warning: Helvetica not found, using Font Substitution. Font cannot be embedded. ]%%
    %%[ Warning: Helvetica-Bold not found, using Font Substitution. Font cannot be embedded. ]%%
    %%[ Warning: Helvetica-BoldOblique not found, using Font Substitution. Font cannot be embedded. ]%%
    When I try and convert the postscript font to a pdf in Acrobat Distiller X the font substitutes to Arial. I have a few versions of Helvetica on my PC but Distiller doesn’t recognise them.
    My question is: how can I tell Distiller, as a default, to substitute to the Helvetica loaded on my PC rather than Arial so that I eliminate the error message and get an accurate pdf.
    Any help would be greatly appreciated.
    Thanks.

    You can set the folders in distiller by going to Settings.  See these two pictures (click on them)
    hope this helps.

  • Font substitution for Times New Roman? Why is Adobe doing this?

    I'm using Adobe Acrobat Pro version 9.2 to read pdfs created by a number of different authors. I'm running Windows 7 64 bit OS. These are NOT pdfs I have created. Some of these pdfs display an incorrect font substitution for Times New Roman and I can't figure out why. In the File/Properties dialog the font property comes up as Times New Roman, True Type, ANSI encoding (Times New Roman has spaces between the words). This font is not embedded. Adobe Sans MM is the font that my Adobe 9.2 substitutes for it, even though I have a true type Times New Roman already installed in Windows.I have installed all updates for both Acrobat and for Windows. If I select the text touch up tool to look at the text, a box comes up saying that the original font is not available and a substitute font will be used. When I look at the drop down box for fonts in Adobe, I see among all of the various fonts available, TimesNewRoman without spaces, but no Times New Roman with spaces. Does this matter?
    When I go to my Windows Control Panel Fonts screen, I see a Times New Roman truetype font available (with spaces, the same as the font the document is requesting). It says OpenType Layout, Digitally Signed, TrueTyepe Outliers. I use it all the time.
    What is required to get Adobe 9 to display this font? It looks like the document is asking for the font I have available on the system and Adobe 9 Pro just isn't identifying it. These same pdfs display just fine on Adobe Acrobat Standard 7.0 on another Windows 7 64 bit OS machine. Is there a separate font library that Adobe has independent of the Windows font library and I simply don't have a complete set of fonts for my version? I don't have the option to have the authors recreate their documents. And they display just fine on an older version of Adobe on a different machine.
    UPDATE: Adobe 9 required more than one update. I did the 300 mb update and the problem described above was still there. I checked again just now for updates, and there was another one. This one, whatever it was, fixed the font substitution problem. So the moral of the story is... update, then update again, and keep doing it until there are no more. Adobe doesn't say "there are xx updates available." You just have to keep on asking for them until it says 'no'.

    The font Radioactive is the problem. It has an incorrect internal name that conflicts with Times New Roman. Delete Radioactive and ban it from any Mac you use.

  • Font substitution.

    I'm on an iMac running 10.4.11 and have updated to Acrobat Reader Version 9.
    I'm receiving PDFs from a colleague whose originating document is using Courier font.
    When the PDF is opened on my system the document's Courier font has been substituted with font: Adobe Sans MM as detailed in the Properties file of the document. Adobe Sans MM does not appear to exist withing my system.
    The originating system is a PC running Vista. The PDFs are created using: doPDF.
    The font substitution does not appear within the originating system.
    Any theories?
    Terry

    > Adobe Sans MM does not appear to exist withing my system.
    Adobe Reader includes this font.
    >
    >The font substitution does not appear within the originating system.
    System font substitutions aren't involved. Adobe Reader makes its own
    font substitutions. Adobe Sans MM and Adobe Serif MM are special
    "mulitple master" fonts used to sythesise a font of the right spacing
    (but not necessarily the right look) when the font is neither embedded
    nor available.
    Aandi Inston

  • Enable syntax highlighting with configuration file in emacs

    When editing configuration files such as .procmailrc, .fetchmailrc, Emacs won't automatically highlight syntax for me.
    I can enable syntax highlighting in Vim by appending "syntax on"  to the .vimrc.
    I tried adding "global-font-lock-mode t" in the .emacs file, but it didn't solve my problem.
    What is the solution?

    igndenok wrote:
    Some of my config file have this (using conf-unix-mode)
    # this is .somerc
    # -*- conf-unix -*-
    Or using this in your .emacs
    (add-to-list 'auto-mode-alist '("\\.*rc$" . conf-unix-mode))
    I followed your advice, and it does have some syntax highlighting, but less than Vim does.
    For example, Vim will highlight all the names of colors in the .muttrc file, but Emacs doesn't.
    I guess Emacs is not as strong as Vim when it comes to editing configuration files.
    Last edited by yu3k (2011-09-14 10:06:47)

  • IBooks author font substitution problem

    Hi
    Ive now been using IBA for a month or so and have to say its a frustrating piece of software.
    This is my latest issue that i cannot resolve.
    Ive been building a book for 2 weeks which is at the publishing stage and then all of a sudden when i opened it this morning it tells me that a font is missing and substitues it.
    But the font is there and i can change everything back by appending the style sheets. Then if i save and close then reopen it tells me the font is missing again.
    I do use Suitcase Fusion but have taken the step to put the fonts i use in IBA only in Font Book as .ttf's.
    Also if i open the file on my Macbook, there is no font substitution and the book displays correctly even though the fonts in  Fontbook are the same ones as on my iMac.
    (Pulls hair out)!!!!
    Anyone have any ideas??

    Yes its been working fine in all preview tests on my iPad and others in the company.
    Plus my Macbook is a carbon copy of my iMac (i use CCC to clone the iMac HD)
    Someone suggested that the two ways to change fonts in IBA causes some differences, apparently the top left dropdown menu when selecting fonts only show whats available for embeding and the drawer you get by clicking the 'A' in the top right shows all the fonts on your system.
    Still cant figure it out!!

  • PDF/A and font substitution

    I've embarked on a mission to scan, download, or otherwise capture all of my records as PDF files.  It seems reasonable to me that I want to save them as PDF/A when possible so that they will look exactly the same 20 years from now as they do today.  (Of course, that significantly increases the size of the files.  But bits are cheap.)  My problem, of course, is that many of the documents I am acquiring (for example, statements downloaded from financial institutions) use fonts that I don't have installed on my computer, so I can't convert them to PDF/A.
    My question is: Do I really need (or want) to convert documents to PDF/A?  Assuming the document doesn't rely on some non-standard font I just happen to have installed on my PC, and the font substitution magic works well enough today to give me a perfectly acceptable document, then can I rely on it working just as well 20 years from now?  Can I rely on font substitution in other vendor's products producing similar results?  Is there anything in the PDF spec that constrains font substitution to producing something similar to what the Adobe products do today?
    TIA - Bob

    BTW, I tried printing a PDF to the PDF printer with the Default Settings option set to "Press Quality" and I got this:
    %%[ ProductName: Distiller ]%%
    %%[ Error: Helvetica-Narrow not found, using Font Substitution. Font cannot be embedded. ]%%
    %%[ Error: typecheck; OffendingCommand: cshow ]%%
    Stack:
    -mark-
    {--pop-- --pop-- ct_str1 --exch-- 0 --exch-- --put-- ct_str1 --show--
    {_ct_na _ct_i --get--} --stopped-- {--pop-- --pop--} {_ct_x _ct_y
    --moveto-- 0 --exch-- --rmoveto--} --ifelse-- /_ct_i _ct_i 1 --add--
    --def-- --currentpoint-- /_ct_y --exch-- --def-- /_ct_x --exch-- --def--}
    %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
    %%[ Warning: PostScript error. No PDF file produced. ] %%
    I tried printing a PDF to the PDF printer with the Default Settings option set to "High Quality Print" and it created a new PDF file.  All of the pages in my original document, which were landscape orientation, became portrait orientation in the new document.  But otherwise I can't see anything obviously different between the two.  In particular, the list of fonts is identical between the old and new documents.  That is, the new document has the same embedded fonts and the same non-embedded (and still missing) fonts.

  • Font Substitution Tables?

    We've recently switched to InDesign from QuarkXPress and something that we had used regularly to account for files coming from Microsoft Word, on Windows PCs, was the font substitution tables in QuarkXPress. With it, we could tell QuarkXPress, via it's preferences, to remember to use "NimrodMT" when it saw "Nimrod MT" in a Word document stylesheet. Same goes for "NimrodMT-Bold" when it encountered "Nimrod MT Bold," etc ... it's a little annoying to have to do this manually, especially when you're receiving 10-15 files per day where the process needs to be manually repeated.
    Can anyone tell me if there exists such a feature in InDesign and where it can be found?
    Thanx

    Hi Peter,
    Maybe I should clarify ... When importing a Word document into QuarkXPress, if there are fonts that don't match you are presented with a dialog box asking you to find replacements. In that dialog you can also set the substitution as a rule so that whenever QuarkXPress encounters the "bad" font it will replace it with the one you selected as a "good" font no matter what document you are working on. If memory serves, you can also set a font substitution rule from the "Usage" window.
    My question is this: Is there a way to make InDesign perform this same funtion?

  • Arial Bold Unwanted Font Substitution

    When I make a PDF from a Word file using Acrobat 9 Standard, the Arial Bold font gets substituted regardless of the font embedding settings. With other PDF creation methods, this does not happen, but I need it to work with Acrobat for some of the features. It is really annoying that the one product I have that is not free does this, when there are other ways of creating PDFs for free that do not do this annoying font substitution. I have observed that this also happened to another user on another machine.
    Does anyone know how to fix this?
    (Using Windows 7. This also happened previously in Windows XP.)

    I do not have a font that is actually called Arial MT on my computer. In some applications, it is referred to as such, for reasons I don't know. I do have Arial Unicode MS and Arial Rounded MT Bold, which I tried deleting from the Fonts directory, and I got excited there for a minute, but I actually got the same result again.
    A few interesting things to mention:
    - When I use the touchup text tool in Acrobat, and I open the properties of the substituted text, it tells me that the font is substituted because the original font is not available. However, I am then able to change the text to Arial Bold, because Arial bold is on my computer! It seems to be looking for a font with a different name, for some reason.
    - I once did a search and replace in Word, replacing all Arial bold with Arial, and then made a PDF. All of my replacement Arial text was still bold but emerged unharmed int he PDF. I thought I had my solution then but the problem is that I cannot search and replace certain items, such as the numbers in my numbered lists. Changing those is a sort of Pandora's box.

  • Xorg configuration file

    Is there anyone using an NVIDIA Geforce GTX 285M card? If so, could you please give me your xorg.conf file? I installed arch linux on my new laptop a week ago and for some reason haven't been able to get xorg to use the nvidia drivers. I am hoping that someone would have an xorg config file, for their GTX 285M card. I would be happy to try it out.. cos Im at my wits end trying to get it to work. All of last week, was just one big drag after another trying to find a solution. This is my last resort... I hate to think i might have to install crap vinduze..
    Thank you.
    PS: actually an xorg.conf file on a system with any of the newest nvidia cards might work I think.
    thaks

    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig: version 1.0 (buildmeister@builder75) Fri Mar 12 01:42:27 PST 2010
    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    EndSection
    Section "Files"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/psaux"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
    EndSection
    Section "InputDevice"
    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    Option "DPMS"
    EndSection
    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    Option "NoLogo" "True"
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    The only line I added was "Option "NoLogo" "True"".
    As you can see, my xorg is very bare and plain. Could that be the reason why Im not getting display? Are there supposed to be certain options that I have missed?
    And is DPMS necessary?
    Thats the xorg.conf file.
    What follows is the log file that you had asked for.
    X.Org X Server 1.7.6
    Release Date: 2010-03-17
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux TheRock 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 CEST 2010 i686
    Kernel command line: root=/dev/sdb1 ro
    Build Date: 01 April 2010 05:35:33PM
    Current version of pixman: 0.18.2
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Sat May 29 09:28:36 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    (==) ServerLayout "Layout0"
    (**) |-->Screen "Screen0" (0)
    (**) | |-->Monitor "Monitor0"
    (**) | |-->Device "Device0"
    (**) |-->Input Device "Keyboard0"
    (**) |-->Input Device "Mouse0"
    (==) Automatically adding devices
    (==) Automatically enabling devices
    (WW) The directory "/usr/share/fonts/Type1" does not exist.
    Entry deleted from font path.
    (==) FontPath set to:
    /usr/share/fonts/misc,
    /usr/share/fonts/100dpi:unscaled,
    /usr/share/fonts/75dpi:unscaled,
    /usr/share/fonts/TTF
    (==) ModulePath set to "/usr/lib/xorg/modules"
    (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    (WW) Disabling Keyboard0
    (WW) Disabling Mouse0
    (II) Loader magic: 0x81e4c60
    (II) Module ABI versions:
    X.Org ANSI C Emulation: 0.4
    X.Org Video Driver: 6.0
    X.Org XInput driver : 7.0
    X.Org Server Extension : 2.0
    (--) using VT number 7
    (--) PCI:*(0:2:0:0) 10de:060f:1558:8687 nVidia Corporation rev 162, Mem @ 0xce000000/16777216, 0xd0000000/268435456, 0xcc000000/33554432, I/O @ 0x00002000/128
    (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    (II) LoadModule: "extmod"
    (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    (II) Module extmod: vendor="X.Org Foundation"
    compiled for 1.7.6, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension MIT-SCREEN-SAVER
    (II) Loading extension XFree86-VidModeExtension
    (II) Loading extension XFree86-DGA
    (II) Loading extension DPMS
    (II) Loading extension XVideo
    (II) Loading extension XVideo-MotionCompensation
    (II) Loading extension X-Resource
    (II) LoadModule: "dbe"
    (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    (II) Module dbe: vendor="X.Org Foundation"
    compiled for 1.7.6, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension DOUBLE-BUFFER
    (II) LoadModule: "glx"
    (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    (**) Logitech Optical USB Mouse: Device: "/dev/input/event11"
    (II) Logitech Optical USB Mouse: Found 3 mouse buttons
    (II) Logitech Optical USB Mouse: Found scroll wheel(s)
    (II) Logitech Optical USB Mouse: Found relative axes
    (II) Logitech Optical USB Mouse: Found x and y relative axes
    (II) Logitech Optical USB Mouse: Configuring as mouse
    (**) Logitech Optical USB Mouse: YAxisMapping: buttons 4 and 5
    (**) Logitech Optical USB Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Logitech Optical USB Mouse" (type: MOUSE)
    (**) Logitech Optical USB Mouse: (accel) keeping acceleration scheme 1
    (**) Logitech Optical USB Mouse: (accel) acceleration profile 0
    (II) Logitech Optical USB Mouse: initialized for relative axes.
    (II) config/hal: Adding input device BisonCam, NB Pro
    (**) BisonCam, NB Pro: always reports core events
    (**) BisonCam, NB Pro: Device: "/dev/input/event10"
    (II) BisonCam, NB Pro: Found keys
    (II) BisonCam, NB Pro: Configuring as keyboard
    (II) XINPUT: Adding extended input device "BisonCam, NB Pro" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Sleep Button
    (**) Sleep Button: always reports core events
    (**) Sleep Button: Device: "/dev/input/event4"
    (II) Sleep Button: Found keys
    (II) Sleep Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Power Button
    (**) Power Button: always reports core events
    (**) Power Button: Device: "/dev/input/event3"
    (II) Power Button: Found keys
    (II) Power Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Video Bus
    (**) Video Bus: always reports core events
    (**) Video Bus: Device: "/dev/input/event7"
    (II) Video Bus: Found keys
    (II) Video Bus: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Power Button
    (**) Power Button: always reports core events
    (**) Power Button: Device: "/dev/input/event6"
    (II) Power Button: Found keys
    (II) Power Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    There are a few warnings regarding ACPI and "AllowEmptyInput". Could that be the problem?
    Thank you very much.

  • PDF Pack font substitutions

    Just subscribed to PDF Pack yesterday. First file I tried to convert came back with font substitutions. Can anything be done about this or shall I cancel my subscription and request a refund? Thx, Mark in Sydney Oz

    Hi,
    Did you try with different file?
    Would you send your document as an email attachment? 
    I will check it from my end.Please add the link to this forum post for reference.
    I have sent you my contact details on your email id.
    Regards,
    Florence

  • [solved]Mono font substitution problem in gnome terminal

    I have to edit mono font substitution in 65-nonlatin* in /etc/fonts/conf.d
    Still don't understand why font rendering in terminal is different from the rest of the system though...
    Don't know where else to post this, so it ends up here...
    I just upgraded fontconfig today and substituted the ubuntu packages (cairo, freetype2 and libxft) with the cleartype ones (as the later are up-to-date and turn out looking cool too).
    The only problem I have now is that mono font substitutiton got messed up in gnome-terminal.
    Both gedit and terminal use the system mono font (which is set to Monospace), with Liberation Mono as the preferred font. But somehow the terminal decides to use a different font (looki like my Chinese font: wenquanyi-zenhei).
    If I tell the terminal to use Liberation Mono, I get a serifed Chinese font, so this is not a solution for me.
    I've read somewhere that gnome-terminal does not follow the system fontconfig? It gave me a lot of trouble the last time I upgrade the relevant files. So unfortunate that it decides to be naughty again this time...
    Last edited by allbluedream (2008-07-30 11:25:08)

    http://wiki.archlinux.org/index.php/Configuring_locales instructed me to 'export LANG=en_EN.utf8' to set the system language to english, yet that locale doesn't exist in locale.gen. Of course, I had neglected to look in locale.gen for such an entry to uncomment it, or I would have noticed the error sooner. All is working now.

  • System wide default configuration files?

    I have six people using the computer, and I don't want to have to configure starting Wicd in the tray for each user or font configuration...
    Is there a way to set up configuration files for new users like Ubuntu and all of the other "tweaked" distros do?

    Doesn't matter where you copy the config files from, so long as they're valid and do what you want.
    Whether configuring your user will give you ~/.config files that do what you want depends. For example, if there's an existing /etc/foo_config file, and you set up your ~/.foo_config file in a way that (whether you realize it or not) depends on the stuff in /etc/foo_config being the system default, and then you copy your ~/.foo_config file to /etc/foo_config (overwriting the old file), then no, it won't work. If you avoid mistakes like that, and end up with ~/.foo_config files that all on their own do what you want, then sure, it will work. (Just check their permissions after you copy them to /etc.)

  • Nano syntax highlighting: catch-all syntax for configuration files

    After years of using nano, I only recently learned that it supports syntax coloring... (Why would they turn that off by default? ) Well, I thought I'll make up for it by making extra good use of it from now on...
    Unfortunately it didn't ship a highlighting syntax for the the kind of files that I use nano the most for: system configuration files.
    So I wrote my own, and after tweaking a bit here and there whenever I encountered a config file for which the highlighting wasn't satisfactory at first, I think the result is now good enough (screenshots below) that it's worth sharing with my fellow Arch users:
    Code & Instructions:
    Here is the syntax definition:
    # config file highlighting
    syntax "conf" "(\.(conf|config|cfg|cnf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
    # default text
    color magenta "^.*$"
    # special values
    icolor brightblue "(^|\s|=)(default|true|false|on|off|yes|no)(\s|$)"
    # keys
    icolor cyan "^\s*(set\s+)?[A-Z0-9_\/\.\%\@+-]+\s*([:]|\>)"
    # commands
    color blue "^\s*set\s+\<"
    # punctuation
    color blue "[.]"
    # numbers
    color red "(^|\s|[[/:|<>(){}=,]|\])[-+]?[0-9](\.?[0-9])*%?($|\>)"
    # keys
    icolor cyan "^\s*(\$if )?([A-Z0-9_\/\.\%\@+-]|\s)+="
    # punctuation
    color blue "/"
    color brightwhite "(\]|[()<>[{},;:=])"
    color brightwhite "(^|\[|\{|\:)\s*-(\s|$)"
    # section headings
    icolor brightyellow "^\s*(\[([A-Z0-9_\.-]|\s)+\])+\s*$"
    color brightcyan "^\s*((Sub)?Section\s*(=|\>)|End(Sub)?Section\s*$)"
    color brightcyan "^\s*\$(end)?if(\s|$)"
    # URLs
    icolor green "\b(([A-Z]+://|www[.])[A-Z0-9/:#?&$=_\.\-]+)(\b|$| )"
    # XML-like tags
    icolor brightcyan "</?\w+((\s*\w+\s*=)?\s*("[^"]*"|'[^']*'|!?[A-Z0-9_:/]))*(\s*/)?>"
    # strings
    color yellow "\"(\\.|[^"])*\"" "'(\\.|[^'])*'"
    # comments
    color white "#.*$"
    color blue "^\s*##.*$"
    color white "^;.*$"
    color white start="<!--" end="-->"
    To install, save the above above code snippet as a file called conf.nanorc in the folder /usr/share/nano/ (or /usr/local/share/nano/ or similar if you feel strongly about the /usr <--> /usr/local separation), and then add the following to the end of the file /etc/nanorc:
    ## Configuration files (catch-all syntax)
    include "/usr/share/nano/conf.nanorc"
    Hints:
    The colors I chose look good (imo) with the terminal background and color settings that I use, but might not look good, or even readable, with yours, so simply change the color names in the code snippet to whatever you prefer - valid color names are:
    If you use a console with white background, you'll have to change at least the white color I chose for comments and punctuation.
    The first code line in the snippet includes a regular expression that defines for which file names this syntax highlighting should be used. Whenever you encounter a config file that is not matched by this, but you would still like to open it with syntax highlighting, you can manually select this syntax with nano's -Y switch, like so:
    nano -Y conf myConfigFile
    Technical Note:
    It's implemented as a single catch-all syntax, since nano chooses which syntax to apply based on the filename, and in the case of config files usually not much can be learned about the content format from the file name extension (.conf can by anything from flat key/value tuples to XML, .ini can be the official INI format or something else, etc...).
    This means that some compromises have been made, so with this highlighting syntax probably no config file looks 100% as good as a highlighting syntax that would be specifically optimized for one kind of config format, but all in all the vast majority of config files should look pretty good.
    Screenshots:
    /etc/rc.conf,  /etc/hosts:
    /etc/pacman.conf,  /etc/group:
    xorg.conf,  some .desktop file:
    httpd.conf (Apache config),  php.ini:
    More screenshots:
    /etc/fonts/fonts.conf (uses XML)
    /etc/inittab
    /etc/fstab
    /etc/inputrc
    /etc/mime.types
    /etc/protocols
    /etc/xinetd.conf
    See Also:
    nano syntax highlighting: GNU makefiles
    Update [2012-01-28]: Made some more improvements to the syntax definition (see post)
    Last edited by sas (2012-02-01 15:26:43)

    doug piston wrote:I deal with alot of .mk files and would love to see it there.
    You mean GNU makefiles?
    I'm afraid they might be out of scope for this generic config-file syntax.
    Logically they're not system config files, and technically they're a pretty specialized and complex format (different "types" of rules, rules spanning multiple lines, rules containing arbitrary Bash code, etc.).
    This is how an .mk file currently looks with this highlighting syntax:
    $ nano -Y conf /usr/lib/httpd/build/rules.mk
    And apart from highlighting variables of the form $$abc or $(abc), I'm not sure how much can be improved here without breaking the highlighting for more conventional config files.
    It would probably be better to create a specialized highlighting syntax just for .mk files.
    EDIT: I sat down and did just that, here's the result: nano syntax highlighting: GNU makefiles, and here is how the above makefile snipped looks with it:
    Last edited by sas (2012-02-01 15:18:52)

Maybe you are looking for