Commit 4df49f4
grid, comments & copyright
Changed files (14)
modifiedlibbirdfont/DefaultCharactersSet.valamodifiedlibbirdfont/EditPointHandle.valamodifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/PenTool.valamodifiedscripts/bavala.pymodifiedscripts/configfile.pymodifiedscripts/export.shmodifiedscripts/macport_build.pymodifiedscripts/macport_configure.pymodifiedscripts/macport_install.pymodifiedscripts/run.pymodifiedscripts/translations.pymodifiedscripts/version.pymodifiedscripts/win_build.py
Diff
@@ -39,8 +39,8 @@ public class DefaultCharacterSet { /** Add a new language to the menu for default character set. * @param language A localized string of the language. * @param language_code ISO code- * @param characters all characters (including characters with diacritical marks)- * for the language. For languages with too many glyphs should this string be left empty. + * @param characters all characters (including characters with diacritical marks).+ * For languages with too many glyphs should this string be left empty. * See the functions for chinese and japanese. */ public static void add_language (string language, string language_code, string characters) {@@ -149,7 +149,6 @@ public class EditPointHandle { public void move_delta (double dx, double dy) { double px = px () + dx * Glyph.ivz (); double py = py () - dy * Glyph.ivz ();- move_to_coordinate (px, py); } @@ -754,6 +754,12 @@ public class Glyph : FontDisplay { return (int) Math.rint ((x - g.view_offset_x + xc ()) * g.view_zoom); } + public static double precise_reverse_path_coordinate_x (double x) {+ Glyph g = MainWindow.get_current_glyph ();+ return_val_if_fail (g.view_zoom != 0, 0);+ return (x - g.view_offset_x + xc ()) * g.view_zoom;+ }+ public static double path_coordinate_y (double y) { Glyph g = MainWindow.get_current_glyph (); return yc () - y * ivz () - g.view_offset_y;@@ -765,6 +771,12 @@ public class Glyph : FontDisplay { return (int) (-y); } + public static double precise_reverse_path_coordinate_y (double y) {+ Glyph g = MainWindow.get_current_glyph ();+ y = (y + g.view_offset_y - yc ()) * g.view_zoom; + return -y;+ }+ public bool select_path (double x, double y) { Path? p = null; bool found = false;@@ -37,9 +37,6 @@ public class PenTool : Tool { public static EditPoint? active_edit_point = new EditPoint (); - /** Move handle vertical or horizontal. */- public static bool tie_x_or_y_coordinates = false;- private static bool move_selected_handle = false; private static double last_point_x = 0;@@ -159,6 +156,8 @@ public class PenTool : Tool { public void move (double x, double y) { Glyph glyph = MainWindow.get_current_glyph (); double coordinate_x, coordinate_y;+ double px = 0;+ double py = 0; control_point_event (x, y); curve_active_corner_event (x, y);@@ -169,7 +168,7 @@ public class PenTool : Tool { move_current_point_on_path (x, y); } - // move curve handles+ // move control point handles if (move_selected_handle) { if (selected_handle.type == PointType.LINE_CUBIC) { selected_handle.set_point_type (PointType.CUBIC);@@ -187,7 +186,9 @@ public class PenTool : Tool { coordinate_x = Glyph.path_coordinate_x (x); coordinate_y = Glyph.path_coordinate_y (y); GridTool.tie_coordinate (ref coordinate_x, ref coordinate_y);- selected_handle.move_to_coordinate (coordinate_x, coordinate_y);+ px = Glyph.reverse_path_coordinate_x (coordinate_x);+ py = Glyph.reverse_path_coordinate_y (coordinate_y);+ selected_handle.move_delta ((px - last_point_x), (py - last_point_y)); } else { selected_handle.move_delta ((x - last_point_x) * precision, (y - last_point_y) * precision); }@@ -196,9 +197,14 @@ public class PenTool : Tool { // Fixa: redraw line only glyph.redraw_area (0, 0, glyph.allocation.width, glyph.allocation.height);- - last_point_x = x;- last_point_y = y;+ + if (GridTool.is_visible ()) {+ last_point_x = Glyph.precise_reverse_path_coordinate_x (selected_handle.x ());+ last_point_y = Glyph.precise_reverse_path_coordinate_y (selected_handle.y ());+ } else {+ last_point_x = x;+ last_point_y = y; + } return; }@@ -210,21 +216,24 @@ public class PenTool : Tool { coordinate_x = Glyph.path_coordinate_x (x); coordinate_y = Glyph.path_coordinate_y (y); GridTool.tie_coordinate (ref coordinate_x, ref coordinate_y);- glyph.move_selected_edit_point_coordinates (p, coordinate_x, coordinate_y);+ px = Glyph.precise_reverse_path_coordinate_x (coordinate_x);+ py = Glyph.precise_reverse_path_coordinate_y (coordinate_y);+ glyph.move_selected_edit_point_delta (p, (px - last_point_x), (py - last_point_y)); } else { glyph.move_selected_edit_point_delta (p, (x - last_point_x) * precision, (y - last_point_y) * precision); } - if (tie_x_or_y_coordinates) {- GridTool.tie_to_prev (p, x, y);- }- p.recalculate_linear_handles (); } } - last_point_x = x;- last_point_y = y;+ if (GridTool.is_visible ()) {+ last_point_x = px;+ last_point_y = py;+ } else {+ last_point_x = x;+ last_point_y = y; + } } @@ -43,6 +43,7 @@ def cmd(name, *args): def get_sources_path (folder, pattern):+ """obtain the path to all source files that matches pattern""" files = [] for root, dirnames, filenames in os.walk(folder): for filename in fnmatch.filter(filenames, pattern):@@ -52,6 +53,7 @@ def get_sources_path (folder, pattern): def get_sources_name (folder, pattern):+ """obtain name of all source files that matches pattern""" files = [] for root, dirnames, filenames in os.walk(folder): for filename in fnmatch.filter(filenames, pattern):@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+Copyright (C) 2012, 2013 Eduardo Naufel Schettino and Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+""" import version import time; @@ -1,4 +1,18 @@ #!/bin/bash+# Copyright (C) 2012, 2013 Johan Mattsson+#+# This program is free software: you can redistribute it and/or modify+# it under the terms of the GNU General Public License as published by+# the Free Software Foundation, either version 3 of the License, or+# (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program. If not, see <http://www.gnu.org/licenses/>. rep="$(pwd)" @@ -1,4 +1,20 @@ #!/usr/bin/python+"""+Copyright (C) 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+""" import os import shutil@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+Copyright (C) 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+""" import configfile from optparse import OptionParser@@ -1,4 +1,21 @@ #!/usr/bin/python+"""+Copyright (C) 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+"""+ import os import subprocess import glob@@ -53,4 +70,4 @@ for lang_dir in glob.glob('build/locale/*'): lc = lang_dir.replace ('build/locale/', "") install ('build/locale/' + lc + '/LC_MESSAGES/birdfont.mo', '/share/locale/' + lc + '/LC_MESSAGES' ); -run ("cp -R -p build/BirdFont.app " + options.app)\ No newline at end of file+run ("cp -R -p build/BirdFont.app " + options.app)@@ -1,4 +1,21 @@ #!/usr/bin/python+"""+Copyright (C) 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+"""+ import subprocess def run(cmd):@@ -1,4 +1,21 @@ #!/usr/bin/python+"""+Copyright (C) 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+"""+ import glob from run import run @@ -1,2 +1,19 @@ #!/usr/bin/python+"""+Copyright (C) 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+"""+ VERSION = '0.20'@@ -1,4 +1,20 @@ #!/usr/bin/python+"""+Copyright (C) 2012 2013 Johan Mattsson++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU General Public License as published by+the Free Software Foundation, either version 3 of the License, or+(at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program. If not, see <http://www.gnu.org/licenses/>.+""" import os import shutil