Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix greek letters #59

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:

- name: Bump Brew
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_TOKEN }}
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREW_TOKEN_GIZA }}
version: ${{ steps.get_version.outputs.version }}
brewtap: danieljprice/all
formula: giza-x11 #${{ steps.get_version.outputs.repo }} # formula name same as repo name
Expand Down
14 changes: 6 additions & 8 deletions LATEST.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Changes in v1.4.2
------------------
- bug fix with build on Mac OS: explicitly request static libs for libgiza.a and libpglot.a
- bug fix with pkg-config failing to find cairo.h
- bug fix with weird black screen on Mac OS after clicking in a plot window (#55)
- issues in test suite fixed (#50)
- bug fix with giza_circle (#52)
- added automated build and test suite to github actions workflow
Changes in v1.4.3
-----------------
- bug fix with parsing longer escape sequences that contain shorter ones, like \beta (containing \b) and \gamma (containing \ga)
- added \odot symbol
- revert marker 1 to point plotting, not resized with character height

15 changes: 15 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Changes in v1.4.3
-----------------
- bug fix with parsing longer escape sequences that contain shorter ones, like \beta (containing \b) and \gamma (containing \ga)
- added \odot symbol
- revert marker 1 to point plotting, not resized with character height

Changes in v1.4.2
------------------
- bug fix with build on Mac OS: explicitly request static libs for libgiza.a and libpglot.a
- bug fix with pkg-config failing to find cairo.h
- bug fix with weird black screen on Mac OS after clicking in a plot window (#55)
- issues in test suite fixed (#50)
- bug fix with giza_circle (#52)
- added automated build and test suite to github actions workflow

v1.4.1
------
- quieter output from mp4 device
Expand Down
24 changes: 12 additions & 12 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for giza 1.4.2.
# Generated by GNU Autoconf 2.72 for giza 1.4.3.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -614,8 +614,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='giza'
PACKAGE_TARNAME='giza'
PACKAGE_VERSION='1.4.2'
PACKAGE_STRING='giza 1.4.2'
PACKAGE_VERSION='1.4.3'
PACKAGE_STRING='giza 1.4.3'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL='http://danieljprice.github.io/giza'

Expand Down Expand Up @@ -1383,7 +1383,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
'configure' configures giza 1.4.2 to adapt to many kinds of systems.
'configure' configures giza 1.4.3 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1454,7 +1454,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of giza 1.4.2:";;
short | recursive ) echo "Configuration of giza 1.4.3:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1584,7 +1584,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
giza configure 1.4.2
giza configure 1.4.3
generated by GNU Autoconf 2.72

Copyright (C) 2023 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1896,7 +1896,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by giza $as_me 1.4.2, which was
It was created by giza $as_me 1.4.3, which was
generated by GNU Autoconf 2.72. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3370,7 +3370,7 @@ fi

# Define the identity of the package.
PACKAGE='giza'
VERSION='1.4.2'
VERSION='1.4.3'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -4998,7 +4998,7 @@ GIZA_VERSION_MAJOR=1

GIZA_VERSION_MINOR=4

GIZA_VERSION_MICRO=2
GIZA_VERSION_MICRO=3

#
# The following specify the interface version numbers for giza.
Expand All @@ -5014,7 +5014,7 @@ GIZA_VERSION_MICRO=2
#
LT_CURRENT=1

LT_REVISION=2
LT_REVISION=3

LT_AGE=1

Expand Down Expand Up @@ -17367,7 +17367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by giza $as_me 1.4.2, which was
This file was extended by giza $as_me 1.4.3, which was
generated by GNU Autoconf 2.72. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -17436,7 +17436,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
giza config.status 1.4.2
giza config.status 1.4.3
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AC_PREREQ(2.61)
m4_define(giza_version_major,1)
m4_define(giza_version_minor,4)
m4_define(giza_version_micro,2)
m4_define(giza_version_micro,3)
AC_INIT([giza],
[giza_version_major.giza_version_minor.giza_version_micro],
[[email protected]],[],
Expand Down
1 change: 1 addition & 0 deletions docs/news/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<div id="content">
<h1>News</h1>
<p>2024.12.03: <a href="https://github.com/danieljprice/giza/releases">1.4.3</a> released.</p>
<p>2024.12.02: <a href="https://github.com/danieljprice/giza/releases">1.4.2</a> released.</p>
<p>2023.11.30: <a href="https://github.com/danieljprice/giza/releases">1.4.1</a> released.</p>
<p>2023.11.28: <a href="https://github.com/danieljprice/giza/releases">1.4.0</a> released.</p>
Expand Down
3 changes: 2 additions & 1 deletion src/giza-points.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,8 @@ _giza_draw_symbol (double xd, double yd, int symbol)
_giza_plus_size (xd, yd, Dev[id].ch);
break;
case 1: /* single small point that scales w/ character height */
_giza_circle_size (xd, yd, 0.5, 1);
/*_giza_circle_size (xd, yd, 0.5, 1);*/
_giza_point (xd, yd);
break;
case 19: /* slightly larger open rect (just shy of 3x size of #6 */
case 16: /* filled square */
Expand Down
16 changes: 7 additions & 9 deletions src/giza-scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static giza_remapped_token_entry const* _giza_remap_token(char const* special);
%}


%x FONT HERSHEY MARKER GREEK ESCAPE
%x FONT HERSHEY MARKER GREEK

%%

Expand All @@ -107,20 +107,18 @@ static giza_remapped_token_entry const* _giza_remap_token(char const* special);
<MARKER>[0-9]{1,2} { const int marker = atoi(yytext); if( marker>=1 && marker<=31 ) { BEGIN(INITIAL); return GIZA_TOKEN_MARKER; } REJECT; }
<MARKER>. { BEGIN(INITIAL); _giza_warning("giza_parse_string", "invalid marker '%s'", yytext); return GIZA_TOKEN_TEXT; }

<INITIAL>"\\"[gG] { BEGIN(GREEK); }
<INITIAL>"\\"[gG] { BEGIN(GREEK); }
<GREEK>[ABGDEZYHIKLMNCOPRSTUFXQWabgdezyhiklmncoprstufxqw] { BEGIN(INITIAL); return GIZA_TOKEN_GREEK; }
<GREEK>. { BEGIN(INITIAL); _giza_warning("giza_parse_string", "invalid greek letter '%c'", *yytext); return GIZA_TOKEN_TEXT; }

<INITIAL>"\\" { BEGIN(ESCAPE); }
<ESCAPE>[a-zA-Z]{2,} { if( _giza_remap_token(yytext) ) { BEGIN(INITIAL); return GIZA_TOKEN_REMAP; } REJECT; }
<ESCAPE>. { BEGIN(INITIAL); return _giza_remap_token(yytext) ? GIZA_TOKEN_REMAP : GIZA_TOKEN_TEXT; /* single character escape sequence or ordinary escaped character meaning */ }
<INITIAL>"\\"[a-zA-Z]{2,} { if( _giza_remap_token(yytext) ) { return GIZA_TOKEN_REMAP; } REJECT; }

<INITIAL>"^" { return GIZA_TOKEN_SUPER; }
<INITIAL>"_" { return GIZA_TOKEN_SUB; }
<INITIAL>"{" { return GIZA_TOKEN_OB; }
<INITIAL>"}" { return GIZA_TOKEN_CB; }

<INITIAL>. { return GIZA_TOKEN_TEXT; }
<INITIAL>. { return _giza_remap_token(yytext) ? GIZA_TOKEN_REMAP : GIZA_TOKEN_TEXT; /* single character escape sequence or ordinary escaped character meaning */ }

<<EOF>> { return GIZA_TOKEN_END; }

Expand All @@ -139,7 +137,7 @@ giza_hershey_to_utf_entry const* _giza_lookup_hershey(int number) {
giza_remapped_token_entry const* _giza_remap_token(char const* special) {
giza_remapped_tokens_entry const* rv = giza_remappable_tokens;

while( rv->text && strcmp(rv->text, special) )
while( rv->text && strcmp(rv->text, special+1) )
rv++;
return (rv->text==NULL ? NULL : &rv->replacement);
}
Expand Down Expand Up @@ -378,15 +376,15 @@ _giza_parse_string (const char *text, double *width, double *height, void (*acti

/* either draw the symbol or increment the width */
if (*width < 0.) {
double dx = 0.75*markerHeight;
double dx = 1.0*markerHeight;
double dy = -0.5*markerHeight;
_giza_draw_symbol_device(positions[nGlyph].x + dx*cosa + dy*sina,
positions[nGlyph].y + dx*sina + dy*cosa,
number);
cairo_move_to(Dev[id].context, positions[nGlyph].x + 2.*dx*cosa, positions[nGlyph].y + 2.*dx*sina); /* restore pen position */
} else {
/* return width if action is _giza_action_get_size */
*width = *width + 1.5*markerHeight;
*width = *width + 2.*markerHeight;
}
}
break;
Expand Down
1 change: 1 addition & 0 deletions src/giza-token-remapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static giza_remapped_tokens_entry giza_remappable_tokens[] = {
{"times", {GIZA_TOKEN_TEXT , "\u00d7" }},
{"int", {GIZA_TOKEN_HERSHEY, "2268" }},
{"nabla", {GIZA_TOKEN_HERSHEY, "2266" }},
{"odot" , {GIZA_TOKEN_MARKER , "9" }},
/* misc */
{"A", {GIZA_TOKEN_TEXT , "\u212b" }}, /* Angstrom */
/* fonts */
Expand Down
Loading
Loading