Merge branch 'bugfix/blockdiag_seqdiag_cn_fonts' into 'master'

Introduce separate fonts used by blockdiag, sequdiag, actdiag, nwdiag, rackdiag…

See merge request idf/esp-idf!4646
This commit is contained in:
Krzysztof Budzynski 2019-05-06 18:09:21 +08:00
commit 417cac6654
8 changed files with 47 additions and 71 deletions

4
.gitignore vendored
View file

@ -36,6 +36,10 @@ docs/*/xml_in/
docs/*/man/
docs/doxygen_sqlite3.db
# Downloaded font files
docs/_static/DejaVuSans.ttf
docs/_static/NotoSansSC-Regular.otf
# Unit test app files
tools/unit-test-app/sdkconfig
tools/unit-test-app/sdkconfig.old

View file

@ -1,58 +0,0 @@
This package was debianized by Peter Cernak <pce@users.sourceforge.net> on
Sun, 5 Sep 2004 17:10:26 +0200.
It was downloaded from http://dejavu.sourceforge.net/
Upstream Authors: Stepan Roh <src@users.sourceforge.net> (original author),
see /usr/share/doc/ttf-dejavu/AUTHORS for full list
Copyright:
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.

Binary file not shown.

View file

@ -152,14 +152,6 @@ extensions = ['breathe',
'html_redirects',
]
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
blockdiag_fontpath = '../_static/DejaVuSans.ttf'
seqdiag_fontpath = '../_static/DejaVuSans.ttf'
actdiag_fontpath = '../_static/DejaVuSans.ttf'
nwdiag_fontpath = '../_static/DejaVuSans.ttf'
rackdiag_fontpath = '../_static/DejaVuSans.ttf'
packetdiag_fontpath = '../_static/DejaVuSans.ttf'
# Enabling this fixes cropping of blockdiag edge labels
seqdiag_antialias = True

View file

@ -64,27 +64,30 @@ Behavior of panic handler is affected by two other configuration options.
The following diagram illustrates panic handler behavior:
.. blockdiag::
:caption: Panic Handler Flowchart
:scale: 100%
:caption: Panic Handler Flowchart (click to enlarge)
:align: center
blockdiag panic-handler {
orientation = portrait;
edge_layout = flowchart;
default_group_color = white;
node_width = 160;
node_height = 60;
cpu_exception [label = "CPU Exception", shape=roundedbox];
sys_check [label = "Cache error,\nInterrupt WDT,\nabort()", shape=roundedbox];
check_ocd [label = "JTAG debugger\nconnected?", shape=diamond, width=160, height=80];
check_ocd [label = "JTAG debugger\nconnected?", shape=diamond, height=80];
print_error_cause [label = "Print error/\nexception cause"];
use_jtag [label = "Send signal to\nJTAG debugger", shape=roundedbox];
dump_registers [label = "Print registers\nand backtrace"];
check_coredump [label = "Core dump\nenabled?", shape=flowchart.condition];
check_coredump [label = "Core dump\nenabled?", shape=diamond, height=80];
do_coredump [label = "Core dump\nto UART or Flash"];
check_gdbstub [label = "GDB Stub\nenabled?", shape=flowchart.condition];
check_gdbstub [label = "GDB Stub\nenabled?", shape=diamond, height=80];
do_gdbstub [label = "Start GDB Stub", shape=roundedbox];
halt [label = "Halt", shape=roundedbox];
reboot [label = "Reboot", shape=roundedbox];
check_halt [label = "Halt?", shape=flowchart.condition];
check_halt [label = "Halt?", shape=diamond, height=80];
group {cpu_exception, sys_check};

View file

@ -10,6 +10,7 @@ import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from conf_common import * # noqa: F401, F403 - need to make available everything from common
from local_util import download_file # noqa: E402 - need to import from common folder
# General information about the project.
project = u'ESP-IDF Programming Guide'
@ -18,3 +19,15 @@ copyright = u'2016 - 2019, Espressif Systems (Shanghai) CO., LTD'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'
# Download font file that is stored on a separate server to save on esp-idf repository size.
print("Downloading font file")
download_file('https://dl.espressif.com/dl/esp-idf/docs/_static/DejaVuSans.ttf', '../_static')
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
blockdiag_fontpath = '../_static/DejaVuSans.ttf'
seqdiag_fontpath = '../_static/DejaVuSans.ttf'
actdiag_fontpath = '../_static/DejaVuSans.ttf'
nwdiag_fontpath = '../_static/DejaVuSans.ttf'
rackdiag_fontpath = '../_static/DejaVuSans.ttf'
packetdiag_fontpath = '../_static/DejaVuSans.ttf'

View file

@ -18,6 +18,7 @@ from __future__ import unicode_literals
from io import open
import os
import shutil
import urllib
def run_cmd_get_output(cmd):
@ -55,3 +56,11 @@ def copy_if_modified(src_path, dst_path):
src_file_path = os.path.join(root, src_file_name)
dst_file_path = os.path.join(dst_path + root[src_path_len:], src_file_name)
copy_file_if_modified(src_file_path, dst_file_path)
def download_file(from_url, to_path):
tmp_file, header = urllib.urlretrieve(from_url)
filename = os.path.basename(from_url)
with open(to_path + "/" + filename, 'wb') as fobj:
with open(tmp_file, 'rb') as tmp:
fobj.write(tmp.read())

View file

@ -10,6 +10,7 @@ import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from conf_common import * # noqa: F401, F403 - need to make available everything from common
from local_util import download_file # noqa: E402 - need to import from common folder
# General information about the project.
project = u'ESP-IDF 编程指南'
@ -18,3 +19,15 @@ copyright = u'2016 - 2019 乐鑫信息科技(上海)股份有限公司'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'zh_CN'
# Download font file that is stored on a separate server to save on esp-idf repository size.
print("Downloading font file")
download_file('https://dl.espressif.com/dl/esp-idf/docs/_static/NotoSansSC-Regular.otf', '../_static')
# Set up font for blockdiag, nwdiag, rackdiag and packetdiag
blockdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
seqdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
actdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
nwdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
rackdiag_fontpath = '../_static/NotoSansSC-Regular.otf'
packetdiag_fontpath = '../_static/NotoSansSC-Regular.otf'