annotate libinterp/corefcn/txt-eng.cc @ 20597:bc6daa38ff50

eliminate more simple uses of error_state * graphics.cc: Eliminate simple uses of error_state.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Oct 2015 14:47:41 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
1 /*
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17327
diff changeset
3 Copyright (C) 2013-2015 Michael Goffioul
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
4
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
5 This file is part of Octave.
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
6
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
10 option) any later version.
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
11
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
15 for more details.
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
16
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
20
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
21 */
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
22
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
24 #include <config.h>
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
25 #endif
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
26
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
27 #include "txt-eng.h"
17327
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
28 #include "oct-tex-symbols.cc"
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
29
17327
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
30 uint32_t
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
31 text_element_symbol::get_symbol_code (void) const
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
32 {
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
33 uint32_t code = invalid_code;
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
34
17327
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
35 if (0 <= symbol && symbol < num_symbol_codes)
fe6518a1d87c Move TeX symbol decoding into the lexer (bug #39831).
Michael Goffioul <michael.goffioul@gmail.com>
parents: 17321
diff changeset
36 code = symbol_codes[symbol][0];
17272
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
37
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
38 return code;
8ce6cdd272eb Support TeX elements in FreeType renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff changeset
39 }