Ask Your Question

Revision history [back]

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, autodetection will be used).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be line this:

soffice --infilter="Text (encoded):UTF8,,Caladea,en-US" --convert-to docx path/to/file.txt

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, autodetection will be used).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be line this:

soffice --infilter="Text (encoded):UTF8,,Caladea,en-US" --convert-to docx path/to/file.txt

to convert a UTF8-encoded plain-text file with autodetected line endings, using Caladea font, and English (USA) language for the imported text.

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, autodetection will be used).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be line like this:

soffice --infilter="Text (encoded):UTF8,,Caladea,en-US" --convert-to docx path/to/file.txt

to convert a UTF8-encoded plain-text file with autodetected line endings, using Caladea font, and English (USA) language for the imported text.

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, autodetection will be used).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be like this:

soffice --infilter="Text (encoded):UTF8,,Caladea,en-US" --convert-to docx path/to/file.txt

to convert a UTF8-encoded plain-text file with autodetected line endings, using Caladea font, and English (USA) language for the imported text.

A side note

LibreOffice is quite smart when it comes to default fonts it uses, which are possibly not available on other systems. For instance, for Liberation Mono, it defines a substitute font in the generated docx (see word/fontTable.xml), which is Courier New; as well as the font properties (fixed-pitch "modern" font), which allows to find a proper substitutions on any system.

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, autodetection will be used).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be like this:

soffice --infilter="Text (encoded):UTF8,,Caladea,en-US" (encoded):UTF8,,Courier New,en-US" --convert-to docx path/to/file.txt

to convert a UTF8-encoded plain-text file with autodetected line endings, using Caladea Courier New font, and English (USA) language for the imported text.

A side note

LibreOffice is quite smart when it comes to default fonts it uses, which are possibly not available on other systems. For instance, for Liberation Mono, it defines a substitute font in the generated docx (see word/fontTable.xml), which is Courier New; as well as the font properties (fixed-pitch "modern" font), which allows to find a proper substitutions on any system.

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, autodetection will be used).CRLF is used on Windows, and CR on all other platforms).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be like this:

soffice --infilter="Text (encoded):UTF8,,Courier New,en-US" --convert-to docx path/to/file.txt

to convert a UTF8-encoded plain-text file with autodetected default line endings, using Courier New font, and English (USA) language for the imported text.

A side note

LibreOffice is quite smart when it comes to default fonts it uses, which are possibly not available on other systems. For instance, for Liberation Mono, it defines a substitute font in the generated docx (see word/fontTable.xml), which is Courier New; as well as the font properties (fixed-pitch "modern" font), which allows to find proper substitutions on any system.

It is very easy to define font name when converting from plain text files.

LibreOffice help includes an example for conversion from plain text file:

--infilter="Text (encoded):UTF8,LF,,"

The help didn't specify what were those missing parameters after LF (now I added that, and it will go to the next help version), but here they are:

  1. UTF8 is encoding used to decode the file.
  2. LF is line ending format (CR and CRLF are the other allowed options; if missing, CRLF is used on Windows, and CRLF on all other platforms).
  3. Font name.
  4. BCP 47 Language tag.

So, the command line could be like this:

soffice --infilter="Text (encoded):UTF8,,Courier New,en-US" --convert-to docx path/to/file.txt

to convert a UTF8-encoded plain-text file with default line endings, using Courier New font, and English (USA) language for the imported text.

A side note

LibreOffice is quite smart when it comes to default fonts it uses, which are possibly not available on other systems. For instance, for Liberation Mono, it defines a substitute font in the generated docx (see word/fontTable.xml), which is Courier New; as well as the font properties (fixed-pitch "modern" font), which allows to find proper substitutions on any system.