commit 4f0e35134bca913821ad7893a9e04fc224b0f8ec
parent 6b448676a2b4ef1da4aa8cbb8a42ad7fcafe4b3c
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date: Fri, 27 Nov 2020 19:40:06 +0100
uml: new directives to change some fonts
Diffstat:
M | uml | | | 30 | ++++++++++++++++++++++++++++++ |
M | uml.README | | | 21 | +++++++++++++++++++++ |
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/uml b/uml
@@ -1,5 +1,14 @@
#!/usr/bin/awk -f
+function print_ft_name() {
+ printf( "\"" );
+ for( i = 2; i < NF; ++i )
+ {
+ printf( "%s ", $i );
+ }
+ printf( "%s\"", $NF );
+}
+
function end_class() {
if( class != "" )
{
@@ -60,6 +69,27 @@ $1 == "splines" {
printf( "splines = %s;\n", $2 );
}
+$1 == "package_font" {
+ end_class();
+ printf( "fontname = " );
+ print_ft_name();
+ printf( ";\n" );
+}
+
+$1 == "class_font" {
+ end_class();
+ printf( "node [fontname = " );
+ print_ft_name();
+ printf( "];\n" );
+}
+
+$1 == "link_font" {
+ end_class();
+ printf( "edge [fontname = " );
+ print_ft_name();
+ printf( "];\n" );
+}
+
$1 == "class" {
end_class();
class = $2;
diff --git a/uml.README b/uml.README
@@ -31,6 +31,9 @@ List of directives:
* friend
* package
* endpackage
+* class_font
+* package_font
+* link_font
==== private ====
@@ -145,3 +148,21 @@ Changes the edge style according to arg 1.
Arg 1: new edge style. Some possible values: true, false,
polyline, ortho, line. See dot(1) for all accepted values.
+
+==== class_font ====
+Closes the current class.
+Set the font used for text inside classes.
+
+Arg 2 to N: font name. Spaces will be merged.
+
+==== package_font ====
+Closes the current class.
+Set the font used for package's names.
+
+Arg 2 to N: font name. Spaces will be merged.
+
+==== link_font ====
+Closes the current class.
+Set the font used for relation names.
+
+Arg 2 to N: font name. Spaces will be merged.