Skip to content

Activate hand tool with spacebar hold, partly based on such MINGW32 functionality.#6

Merged
khaledhosny merged 2 commits intofontforge:masterfrom
jhps:spacebar-move
Aug 18, 2012
Merged

Activate hand tool with spacebar hold, partly based on such MINGW32 functionality.#6
khaledhosny merged 2 commits intofontforge:masterfrom
jhps:spacebar-move

Conversation

@jhps
Copy link
Copy Markdown
Contributor

@jhps jhps commented Aug 16, 2012

Note: Has not been compiled under MINGW32.

@jhps
Copy link
Copy Markdown
Contributor Author

jhps commented Aug 17, 2012

The undefs are probably nukable. I don't have any Windows to test with here.

@khaledhosny
Copy link
Copy Markdown
Contributor

OK, so please remove them. If build breaks on Windows, we will deal with it. What about the other issue?

@jhps
Copy link
Copy Markdown
Contributor Author

jhps commented Aug 17, 2012

I will remove the undefs.

On the key mapping: we have X (XK_), Windows (VK_) , and fontforge GK. We could add two general functions to map from GK to XK and from GK to VK. Some of the mapping is null, it looks like GK is just XK with X enabled, and most printable characters are used with no macros in the main code. We can add abort()s for unkowns. I will not be able to test the windows code.

@khaledhosny
Copy link
Copy Markdown
Contributor

To be honest, I'm not so worried about breaking Windows. The MingW32 code was mostly written by some Japanese developers who didn't even contact us, a while ago George scrapped most of their patches and applied them, but they still carry some delta in their builds, so if Windows support breaks I'm sure they will figure out how to fix it.

…unimplemented cases.

Currently only translation from SPACE is used.
A more ornate system may be needed so as not to replicate the gkeysym header if general
configurable keybinding is eventually implemented.
khaledhosny added a commit that referenced this pull request Aug 18, 2012
Activate hand tool with spacebar hold, partly based on such MINGW32 functionality.
@khaledhosny khaledhosny merged commit d2e248f into fontforge:master Aug 18, 2012
@mpetroff
Copy link
Copy Markdown
Member

The build still works on Windows under MingGW.

@davelab6
Copy link
Copy Markdown
Member

But does the spacebar-activating-hand-tool feature work? :)

khaledhosny added a commit that referenced this pull request Aug 27, 2012
I don't know why it is crshing now (may be the resources?) as this code have
been like that since the dawn of time.

Traceback:

  0xb78289b0 in check_image_buffers (gdisp=0x84d5c78, neww=<optimized out>, newh=7, is_bitmap=0) at gimagexdraw.c:1705
  1705	    if ( width > gdisp->gg.iwidth || depth!=gdisp->gg.img->depth ) {
  (gdb) bt
  #0  0xb78289b0 in check_image_buffers (gdisp=0x84d5c78, neww=<optimized out>, newh=7, is_bitmap=0) at gimagexdraw.c:1705
  #1  0xb782b595 in gximage_to_ximage (image=0x8527ff0, src=0xbfffa0a0, gw=<optimized out>) at gimagexdraw.c:1778
  #2  0xb782e8c2 in _GXDraw_Image (_w=0x9bf4bb0, image=<optimized out>, src=0xbfffa0a0, x=8250, y=7) at gimagexdraw.c:1981
  #3  0xb7807a98 in GDrawDrawScaledImage (w=0x9bf4bb0, img=0x8527ff0, x=8250, y=7) at gdraw.c:488
  #4  0xb781b513 in GListMarkDraw (pixmap=0x9bf4bb0, x=8250, y=1, height=19, state=gs_enabled) at ggadgets.c:482
  #5  0xb788c493 in GMatrixEdit_SubExpose (gme=0x9bd9448, pixmap=0x9bf4bb0, event=0xbfffa400) at gmatrixedit.c:1691
  #6  0xb788c6b1 in matrixeditsub_e_h (gw=0x9bf4bb0, event=0xbfffa400) at gmatrixedit.c:1723
  #7  0xb78040da in _GWidget_Container_eh (gw=0x9bd9178, event=0xbfffa400) at gcontainer.c:269
  #8  0xb7878001 in dispatchEvent (gdisp=0x84d5c78, event=0xbfffa5ec) at gxdraw.c:3959
  #9  0xb7878162 in GXDrawProcessOneEvent (gdisp=0x84d5c78) at gxdraw.c:3991
  #10 0xb7808606 in GDrawProcessOneEvent (gdisp=0x84d5c78) at gdraw.c:748
  #11 0x080c77ff in ContextChainEdit (sf=0x9aa3c68, fpst=0x8ad982c, gfi=0x9afbfc0, newname=0x0, layer=1) at contextchain.c:3207
  #12 0x0818f14a in _LookupSubtableContents (sf=0x9aa3c68, sub=0x8a9d43c, sd=0x0, def_layer=1) at lookupui.c:5531
  #13 0x0813138d in LookupSubtableContents (gfi=0x9afbfc0, isgpos=0) at fontinfo.c:5941
  #14 0x08136a16 in LookupMouse (gfi=0x9afbfc0, isgpos=0, event=0xbfffe930) at fontinfo.c:7336
  #15 0x08136ccc in lookups_e_h (gw=0x9b98230, event=0xbfffe930, isgpos=0) at fontinfo.c:7380
  #16 0x08136d78 in gsublookups_e_h (gw=0x9b98230, event=0xbfffe930) at fontinfo.c:7399
  #17 0xb788f3b0 in drawable_e_h (pixmap=0x9b98230, event=0xbfffe930) at gdrawable.c:219
  #18 0xb78048a7 in _GWidget_Container_eh (gw=0x9b98230, event=0xbfffe930) at gcontainer.c:393
  #19 0xb7878001 in dispatchEvent (gdisp=0x84d5c78, event=0xbfffeb1c) at gxdraw.c:3959
  #20 0xb7878480 in GXDrawEventLoop (gd=0x84d5c78) at gxdraw.c:4058
  #21 0xb78086c1 in GDrawEventLoop (gdisp=0x84d5c78) at gdraw.c:766
  #22 0x0822457c in main (argc=1, argv=0xbffff134) at startui.c:1501
@mpetroff
Copy link
Copy Markdown
Member

Pressing the space bar now switches to editing the space character in the MinGW build.

@jhps
Copy link
Copy Markdown
Contributor Author

jhps commented Aug 28, 2012

The GlyphAutoGoto preference is not presently overridden IIRC. Was that set in the MinGW case?

@davelab6
Copy link
Copy Markdown
Member

davelab6 commented Sep 9, 2012

@mpetroff if you go to preferences, navigation and turn off 'autogoto' and then open a character view, will holding the spacebar turn on the hand tool while the spacebar is pressed? :)

@mpetroff
Copy link
Copy Markdown
Member

mpetroff commented Sep 9, 2012

If "autogoto" is turned off, the space bar activates the hand tool. Previously, it worked even if the preference was on, so I never checked the preference.

@vernnobile vernnobile mentioned this pull request Sep 11, 2013
blipvert added a commit to blipvert/fontforge that referenced this pull request Dec 15, 2013
The parameters are:
    1. Italic angle (as implemented previously).
    2. Italic xheight, as a fraction of the font xheight.
    3. Flags: an integer composed of the following bit values:
       * 0x0001 = Transform bottom serifs.
       * 0x0002 = Transform serifs at x-height.
       * 0x0004 = Transform serifs on ascenders.
       * 0x0008 = Transform diagonal serifs.
       * 0x0010 = Create italic a from the bottom half of italic d.
       * 0x0020 = Give italic f a long tail.
       * 0x0040 = Give italic f a hook.
       * 0x0080 = Remove serifs from descenders.
       * 0x0100 = Special handling for Cyrillic phi.
       * 0x0200 = Special handling for Cyrillic i.
       * 0x0400 = Special handling for Cyrillic pi.
       * 0x0800 = Special handling for Cyrillic te.
       * 0x1000 = Special handling for Cyrillic sha.
       * 0x2000 = Special handling for Cyrillic dje.
       * 0x4000 = Special handling for Cyrillic dzhe.
    4. Serif type: 1=flat, 2=simple slant, 3=complex slant.
    5. LSB change: left bearings will be multiplied by this factor.
    6. Stem width change: stem widths are multiplied by this factor.
    7. Counters change: counters will be multiplied by this factor.
    8. Stem width change for lowercase characters; defaults to fontforge#6.
    9. Counters change for lowercase characters; defaults to fontforge#7.
blipvert added a commit to blipvert/fontforge that referenced this pull request Dec 16, 2013
The parameters are:
    1. Italic angle (as implemented previously).
    2. Italic xheight, as a fraction of the font xheight.
    3. Flags: an integer composed of the following bit values:
       * 0x0001 = Transform bottom serifs.
       * 0x0002 = Transform serifs at x-height.
       * 0x0004 = Transform serifs on ascenders.
       * 0x0008 = Transform diagonal serifs.
       * 0x0010 = Create italic a from the bottom half of italic d.
       * 0x0020 = Give italic f a long tail.
       * 0x0040 = Give italic f a hook.
       * 0x0080 = Remove serifs from descenders.
       * 0x0100 = Special handling for Cyrillic phi.
       * 0x0200 = Special handling for Cyrillic i.
       * 0x0400 = Special handling for Cyrillic pi.
       * 0x0800 = Special handling for Cyrillic te.
       * 0x1000 = Special handling for Cyrillic sha.
       * 0x2000 = Special handling for Cyrillic dje.
       * 0x4000 = Special handling for Cyrillic dzhe.
    4. Serif type: 1=flat, 2=simple slant, 3=complex slant.
    5. LSB change: left bearings will be multiplied by this factor.
    6. Stem width change: stem widths are multiplied by this factor.
    7. Counters change: counters will be multiplied by this factor.
    8. Stem width change for lowercase characters; defaults to fontforge#6.
    9. Counters change for lowercase characters; defaults to fontforge#7.
blipvert added a commit to blipvert/fontforge that referenced this pull request Dec 16, 2013
The parameters are:
    1. Italic angle (as implemented previously).
    2. Italic xheight, as a fraction of the font xheight.
    3. Flags: an integer composed of the following bit values:
       * 0x0001 = Transform bottom serifs.
       * 0x0002 = Transform serifs at x-height.
       * 0x0004 = Transform serifs on ascenders.
       * 0x0008 = Transform diagonal serifs.
       * 0x0010 = Create italic a from the bottom half of italic d.
       * 0x0020 = Give italic f a long tail.
       * 0x0040 = Give italic f a hook.
       * 0x0080 = Remove serifs from descenders.
       * 0x0100 = Special handling for Cyrillic phi.
       * 0x0200 = Special handling for Cyrillic i.
       * 0x0400 = Special handling for Cyrillic pi.
       * 0x0800 = Special handling for Cyrillic te.
       * 0x1000 = Special handling for Cyrillic sha.
       * 0x2000 = Special handling for Cyrillic dje.
       * 0x4000 = Special handling for Cyrillic dzhe.
    4. Serif type: 1=flat, 2=simple slant, 3=complex slant.
    5. LSB change: left bearings will be multiplied by this factor.
    6. Stem width change: stem widths are multiplied by this factor.
    7. Counters change: counters will be multiplied by this factor.
    8. Stem width change for lowercase characters; defaults to fontforge#6.
    9. Counters change for lowercase characters; defaults to fontforge#7.
jtanx added a commit to jtanx/fontforge that referenced this pull request Jun 16, 2015
This has been pulled from http://www.geocities.jp/meir000/fontforge/fontforge-20150121-cygwin.patch.txt

Pull fontforge#6 did not correctly implement the spacebar hand tool activation.
jtanx added a commit to jtanx/fontforge that referenced this pull request Jun 16, 2015
This has been pulled from http://www.geocities.jp/meir000/fontforge/fontforge-20150121-cygwin.patch.txt

Pull fontforge#6 did not correctly implement the spacebar hand tool activation.
jtanx added a commit to jtanx/fontforge that referenced this pull request Jun 16, 2015
This has been pulled from http://www.geocities.jp/meir000/fontforge/fontforge-20150121-cygwin.patch.txt

Pull fontforge#6 did not correctly implement the spacebar hand tool activation.
@ghost ghost mentioned this pull request Sep 10, 2016
@serval2412 serval2412 mentioned this pull request Apr 6, 2019
10 tasks
@pnemade pnemade mentioned this pull request Feb 14, 2020
8 tasks
Omnikron13 pushed a commit to Omnikron13/fontforge that referenced this pull request May 31, 2022
==10627==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00010e2239c1 at pc 0x000111258c3d bp 0x7ffee286c210 sp 0x7ffee286b988
WRITE of size 4 at 0x00010e2239c1 thread T0
    #0 0x111258c3c in scanf_common(void*, int, bool, char const*, __va_list_tag*) (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x27c3c)
    #1 0x111258d6d in wrap_vsscanf (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x27d6d)
    #2 0x11125902c in wrap_sscanf (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x2802c)
    fontforge#3 0x10de70b21 in PrefsUI_LoadPrefs prefs.c:1230
    fontforge#4 0x10e02e0ce in fontforge_main startui.c:1109
    fontforge#5 0x10d654b11 in main main.c:33
    fontforge#6 0x7fff62d7b3d4 in start (libdyld.dylib:x86_64+0x163d4)

0x00010e2239c1 is located 63 bytes to the left of global variable 'fvhintingneededcol' defined in '../fontforgeexe/fontview.c:123:14' (0x10e223a00) of size 4
0x00010e2239c1 is located 0 bytes to the right of global variable 'warn_script_unsaved' defined in '../fontforgeexe/fontview.c:83:6' (0x10e2239c0) of size 1
SUMMARY: AddressSanitizer: global-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x27c3c) in scanf_common(void*, int, bool, char const*, __va_list_tag*)

warn_script_unsaved is declared as bool, but prefs.c:1230 casts its
pointer to int *, leading the issue above. Prefs of type pr_bool should
be int as well, FontForge is pre-C99 and does not know bool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants