How to display these characters
Dear all, I have this: \starttext \starttyping foo └── bar ├── baz │ └── index.html └── index.html \stoptyping \stoptext The source code is generated with the linux command "tree". The special characters which indicate the folder depth are not displayed. I guess that I could define a fallbackfont. Do anyone know the unicode range that should be covered and the font that has these characters? TIA juh
juh+ntg-context--- via ntg-context schrieb am 05.08.2022 um 19:04:
Dear all,
I have this:
\starttext
\starttyping foo └── bar ├── baz │ └── index.html └── index.html
\stoptyping
\stoptext
The source code is generated with the linux command "tree".
The special characters which indicate the folder depth are not displayed.
I guess that I could define a fallbackfont. Do anyone know the unicode range that should be covered and the font that has these characters?
You need box drawing [1] characters. When you need fonts with a wide range of character the Noto [2] family is a good choice. %%%% begin example \definefontfamily [noto] [rm] [Noto Serif] \definefontfamily [noto] [ss] [Noto Sans] \definefontfamily [noto] [tt] [Noto Sans Mono] \definetypeface [noto] [mm] [math] [pagella] [default] \setupbodyfont [noto] \starttext \starttyping foo └── bar ├── baz │ └── index.html └── index.html \stoptyping \stoptext %%%% end example [1] https://unicode.org/charts/PDF/U2500.pdf [2] https://github.com/notofonts/noto-fonts Wolfgang
Am 05.08.22 um 20:07 schrieb Wolfgang Schuster via ntg-context:
juh+ntg-context--- via ntg-context schrieb am 05.08.2022 um 19:04:
\starttyping foo └── bar ├── baz │ └── index.html └── index.html
\stoptyping
The source code is generated with the linux command "tree".
I guess that I could define a fallbackfont. Do anyone know the unicode range that should be covered and the font that has these characters?
You need box drawing [1] characters.
When you need fonts with a wide range of character the Noto [2] family is a good choice.
Yes, also e.g. Segoe UI Symbols, Apple Symbols, Symbola, Droid Sans Fallback. I recently had the same problem and was wondering if there isn’t a Metapost module for directory trees? Hraban
On 05/08/22 05/08/22, 12:13, Henning Hraban Ramm via ntg-context wrote:
I recently had the same problem and was wondering if there isn’t a Metapost module for directory trees?
There is a Metapost/Context module for drawing flow charts that should handle this nicely. There is also a Metapost module for drawing relational charts ("nodes") that could be another approach. -- Alan
Am 08.08.22 um 08:01 schrieb Alan Braslau:
On 05/08/22 05/08/22, 12:13, Henning Hraban Ramm via ntg-context wrote:
I recently had the same problem and was wondering if there isn’t a Metapost module for directory trees?
There is a Metapost/Context module for drawing flow charts that should handle this nicely.
If that’s still the same module that I know, then I don’t think it’s suitable (too much fixed on a grid).
There is also a Metapost module for drawing relational charts ("nodes") that could be another approach.
I actually never really looked into the nodes module, but I guess that would work. Hraban
Henning Hraban Ramm via ntg-context schrieb am 09.08.2022 um 16:51:
Am 08.08.22 um 08:01 schrieb Alan Braslau:
On 05/08/22 05/08/22, 12:13, Henning Hraban Ramm via ntg-context wrote:
I recently had the same problem and was wondering if there isn’t a Metapost module for directory trees?
There is a Metapost/Context module for drawing flow charts that should handle this nicely.
If that’s still the same module that I know, then I don’t think it’s suitable (too much fixed on a grid).
There is also a Metapost module for drawing relational charts ("nodes") that could be another approach.
I actually never really looked into the nodes module, but I guess that would work.
There is a simple LaTeX / plain TeX package [1] for this but I don't know if the plain TeX version works with ConTeXt. [1] https://www.ctan.org/pkg/dirtree Wolfgang
Am 09.08.22 um 18:57 schrieb Wolfgang Schuster via ntg-context:
Henning Hraban Ramm via ntg-context schrieb am 09.08.2022 um 16:51:
I actually never really looked into the nodes module, but I guess that would work.
There is a simple LaTeX / plain TeX package [1] for this but I don't know if the plain TeX version works with ConTeXt. [1] https://www.ctan.org/pkg/dirtree
That is advertised as “like Windows Explorer”, so I expected folder and file icons, but it makes quite ugly lines with square nodes. Line drawing glyphs look better IMO, and the MP nodes module is probably even better, but I need to try... Hraban
On Tue, 9 Aug 2022, Henning Hraban Ramm via ntg-context wrote:
Am 09.08.22 um 18:57 schrieb Wolfgang Schuster via ntg-context:
Henning Hraban Ramm via ntg-context schrieb am 09.08.2022 um 16:51:
I actually never really looked into the nodes module, but I guess that would work.
There is a simple LaTeX / plain TeX package [1] for this but I don't know if the plain TeX version works with ConTeXt. [1] https://www.ctan.org/pkg/dirtree
That is advertised as “like Windows Explorer”, so I expected folder and file icons, but it makes quite ugly lines with square nodes.
Looking at the documentation, it appears that the size of the square node is configurable. So, if you set the size to be the same as line width, the square will be invisible.
Line drawing glyphs look better IMO, and the MP nodes module is probably even better, but I need to try...
It should be relatively easy to write a function that draws such trees without using any module as well. Aditya
participants (5)
-
Aditya Mahajan
-
Alan Braslau
-
Henning Hraban Ramm
-
juh+ntg-context@mailbox.org
-
Wolfgang Schuster