Werner LEMBERG | 28 Jul 07:07 2015
Picon

[ft] new `freetype-commit' mailing list


A new mailing list `freetype-commit' is available.  It track commits
to the FreeType git repositories.  Subscription can be done using the
standard ways, i.e., either via e-mail or using the web interface.

See

  http://freetype.org/contact.html

for more details how to subscribe.

    Werner
高博远 | 11 Jul 18:29 2015
Picon

[ft] FT_New_Face returning 33.

I've searched for a long time and it's driving me crazy.

Can't there be a list of what these error codes mean?
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
John Cary | 7 Jul 20:26 2015

[ft] CMakeLists.txt patch

To ensure not built shared on Windows, which does not work
due to lack of declspec's.  Adds versioning of shared libraries.
Adds creation of freetype-config on unix.

Donation to project if it wants it.

John Cary
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d22293..fa0c439 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
 <at>  <at>  -100,6 +100,9  <at>  <at>  else ()
   endif ()
 endif ()

+if (WIN32 AND BUILD_SHARED_LIBS)
+  message(FATAL_ERROR "Shared libraries not supported on Windows.")
+endif ()

 project(freetype)

 <at>  <at>  -300,6 +303,13  <at>  <at>  add_library(freetype
   ${PRIVATE_HEADERS}
   ${BASE_SRCS}
 )
+if (BUILD_SHARED_LIBS)
+  set_target_properties(freetype PROPERTIES
+    SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
+    VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
+    COMPILE_DEFINITIONS freetype_EXPORTS
+  )
+endif ()

 
 if (BUILD_FRAMEWORK)
 <at>  <at>  -339,6 +349,32  <at>  <at>  if (HARFBUZZ_FOUND)
   include_directories(${HARFBUZZ_INCLUDE_DIRS})
 endif ()

+# Create the configure file
+if (UNIX)
+  set(enable_shared)
+  if (BUILD_SHARED_LIBS)
+    set(enable_shared "yes")
+  endif ()
+  execute_process(COMMAND mkdir -p ${PROJECT_BINARY_DIR}/builds/unix)
+  execute_process(
+    COMMAND sed -e "s?%prefix%? <at> CMAKE_INSTALL_PREFIX <at> ?g"
+      -e "s?%exec_prefix%? <at> CMAKE_INSTALL_PREFIX <at> /bin?g"
+      -e "s?%exec_prefix_set%?no?g"
+      -e "s?%includedir%? <at> CMAKE_INSTALL_PREFIX <at> /include?g"
+      -e "s?%libdir%? <at> CMAKE_INSTALL_PREFIX <at> /lib?g"
+      -e "s?%build_libtool_libs%? <at> enable_shared <at> ?g"
+    INPUT_FILE ${PROJECT_SOURCE_DIR}/builds/unix/freetype-config.in
+    OUTPUT_FILE ${PROJECT_BINARY_DIR}/builds/unix/freetype-config-cmake.in
+  )
+  configure_file(${PROJECT_BINARY_DIR}/builds/unix/freetype-config-cmake.in
+    builds/unix/freetype-config
+     <at> ONLY
+  )
+  execute_process(COMMAND chmod 775 builds/unix/freetype-config)
+  install(PROGRAMS ${PROJECT_BINARY_DIR}/builds/unix/freetype-config
+    DESTINATION bin
+  )
+endif ()

 # Installations
 # Note the trailing slash in the argument to the `DIRECTORY' directive
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
DK | 6 Jul 15:12 2015
Picon

[ft] How to determine which Unicode blocks a True Type font supports?

Is there a way using FreeType on Windows to determine:

1.       Which Unicode blocks (as per http://unicode.org/ V8.0.0) the font supports?

2.       In the blocks it supports, how many of the characters are supported?

 

For example, TrueType font Symbola all 48 characters of Unicode block “Miscellaneous Mathematical Symbols-A” (U+27C0 – U+27EF), all 116 characters in the Unicode block “Alchemical symbols” (U+1F700 – U+1F77F) but only 4 characters of Unicode block “Latin Extended-E” (U+AB30 - U+AB65).

 

Note: Windows works with surrogates and not the Unicode integer value for characters above 0xFFFF (i.e. not in the BMP).

 

I assume one has to process the cmap table but this does not seem as easy as I had hoped.  It doesn’t help that the cmap seems to be big endian and Windows is little endian!

 

Many thanks.

_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
suzuki toshiya | 1 Jul 09:11 2015
Picon

Re: [ft] virtual box

It's hard to understand what you want to be fixed.

Gerald C Brewer wrote:
> hey
> i have a windows 8 computer but when i download virtual box it only allows
> a 32 bit option. is there a fix
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Freetype mailing list
> Freetype <at> nongnu.org
> https://lists.nongnu.org/mailman/listinfo/freetype
Werner LEMBERG | 1 Jul 09:12 2015
Picon

Re: [ft] virtual box


> i have a windows 8 computer but when i download virtual box it only
> allows a 32 bit option. is there a fix

Wrong list, sorry.  We are related to the FreeType library.

    Werner
Gerald C Brewer | 1 Jul 01:24 2015
Picon

[ft] virtual box

hey 
i have a windows 8 computer but when i download virtual box it only allows a 32 bit option. is there a fix 
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
Yaron Cohen-Tal | 26 Jun 10:35 2015
Picon

[ft] Building Freetype 2.6 for Android fails with "arm-linux-androideabi-ranlib: not found".

Hi,

Did any1 succeed with building and installing freetype in Android? I use the following script to build it:

    #!/bin/sh
    export PLATFORM_PREFIX=/opt/android/ndk-standalone_toolchain-r10e-4.9
    export NDKROOT=/opt/android/android-ndk-r10e
    export ARCH_ABI="arm-linux-androideabi-4.9"
    export ANDROID_PLATFORM=android-21
    sudo rm -rf $PLATFORM_PREFIX
    sudo mkdir -p $PLATFORM_PREFIX
    sudo $NDKROOT/build/tools/make-standalone-toolchain.sh --platform=$ANDROID_PLATFORM \
        --system=linux-x86_64 --arch=arm --abis=armeabi-v7a --ndk-dir=$NDKROOT \
        --toolchain=$ARCH_ABI --install-dir=$PLATFORM_PREFIX
    sudo chmod -R 755 $PLATFORM_PREFIX
    export PATH=$PLATFORM_PREFIX/bin:$PATH
    export HOST=arm-linux-androideabi
    BUILD_DIR=freetype-android-standalone-2.6
    rm -rf $BUILD_DIR
    mkdir $BUILD_DIR
    cd $BUILD_DIR
    ../../src/freetype-2.6/configure --host=$HOST --prefix=$PLATFORM_PREFIX \
        --without-zlib --with-png=no
    make -j4
    sudo make install


And the "sudo make install" step it fails with:

libtool: install: arm-linux-androideabi-ranlib /opt/android/ndk-standalone_toolchain-r10e-4.9/lib/libfreetype.a
/home/yaronct/build/freetype-android-standalone-2.6/libtool: 1: eval: arm-linux-androideabi-ranlib: not found
/home/yaronct/src/freetype-2.6/builds/unix/install.mk:32: recipe for target 'install' failed
make: *** [install] Error 127


but the file exists and it's in the "PATH":
which arm-linux-androideabi-ranlib /opt/android/ndk-standalone_toolchain-r10e-4.9/bin/arm-linux-androideabi-ranlibAnd has the required permissions:-rwxr-xr-x 1 root root 732696 Nov 4 05:27 /opt/android/ndk-standalone_toolchain-r10e-4.9/bin/arm-linux-androideabi-ranlibI'm using Debian 8.1 for AMD64.

Thanx,
Yaron.
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
Lawrence D'Oliveiro | 26 Jun 00:34 2015
Picon

Re: [ft] Help with making sure all characters fit in Certain pixel dimensions

On Thu, 25 Jun 2015 16:10:06 -0500, Shomari Sharpe wrote:

> I'm creating an font system that uses bitmap fonts generated from
> freetype to be used in my game engine. It appears that even though I
> have specified a pixel size of 64px there are characters that are
> rendered outside the actual pixel size I have specified though the
> actual FT_Face->Glyph->Bitmap is actually smaller the 64px. There
> also seems to be a big gap of approximately 12px above glyphs.

The interpretation of the “size” of the font is very much up to the
font designer. Looking at the bitmap you supplied, the baseline of the
text is situated 64 pixels from the top of the image. But you forgot to
take into account descenders--those characters that extend below the
baseline.

If you want text to fit into an exact cell size, I would suggest
rendering all the needed glyphs into a larger image while measuring
them individually, to find the largest extents. Then use those largest
extents to compute a scale factor to shrink them all down uniformly to
fit into the desired cell dimensions.

The result will probably not look as good as the font designer intended.

_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
Shomari Sharpe | 25 Jun 23:10 2015
Picon

[ft] Help with making sure all characters fit in Certain pixel dimensions

Hi,
I'm creating an font system that uses bitmap fonts generated from freetype to be used in my game engine. It appears that even though I have specified a pixel size of 64px there are characters that are rendered outside the actual pixel size I have specified though the actual FT_Face->Glyph->Bitmap is actually smaller the 64px. There also seems to be a big gap of approximately 12px above glyphs. Below is the code I am using for placement on a flat bitmap.

------------------------------------- CODE -----------------------------------------
font_size = 64;

        /* convert to an anti-aliased bitmap */
        FT_Render_Glyph( freetype_face->glyph, FT_RENDER_MODE_LCD );

        //This reference will make accessing the bitmap easier
        FT_Bitmap& bitmap=freetype_face->glyph->bitmap;
       
for (int y = 0; y < bitmap.rows; y++)
            for (int x = 0; x < bitmap.width; x++)
            {
                pixel_t pixel = { 0, 0, 0, bitmap.buffer[bi]};
                putpixel((xoffset+x), (yoffset+y+ font_size-abs(freetype_face->glyph->bitmap_top)), maxwidth, fontdata, pixel);
                bi++;
            }
xoffset += bitmap.width;

---------------------------------- END CODE ------------------------------------

I've included a sample png image showing the results. Help please?


Regards,
Shomari Sharpe
_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
Jun Dai | 18 Jun 01:39 2015

[ft] Possible Bug in FT_Get_FSType_Flags

Deal FreeType Organization,

Thank you for this wonderful library. This is Jun Dai from Prevo Tech.

Currently I experience a strange behave from FT_Get_FSType_Flags call. I load a True Type font from system and use FT_Get_FSType_Flags call to check if this font is editable or not.  
According to FreeType document, the FT_GetFSType should return one of the FT_FSTYPE_XXX flag. But I receive a 1, which is not listed as any of those flags.
The test font is a restricted true type font. I was expecting a return of FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING flag.

 

The following is the testing code.
I am on windows 8.1 pro.
FreeType is 2.6 windows build.  

 

--- Start of Test Code ---

 

int _tmain(int argc, _TCHAR* argv[])

{

       //Free Type Library, it use to load font for library

       FT_Library _library = NULL;

 

       //initial Free Type library;

       FT_Error error = FT_Init_FreeType( &_library );

       if(error)

       {

             return 0;

       }

       //windows font, which is a restricted font

       const char* WINDOWSFONT = "C:\\Windows\\Fonts\\sanss___.ttf";

 

       //load file

       FILE* ffile = NULL;

       int errorcode = fopen_s(&ffile, WINDOWSFONT, "rb");

       if(errorcode == 0 && ffile != NULL)

       {

             //copy font file into memory

             fseek(ffile, 0, SEEK_END);

             int fontFileSize = ftell(ffile);

             fseek(ffile, 0, SEEK_SET);

             BYTE* fontFile = new BYTE[fontFileSize];

             int remain = fontFileSize;

             BYTE* tempbuff = fontFile;

             while(remain > 0)

             {

                    int rbyte = fread(tempbuff, 1, remain, ffile);

                    if(rbyte < 1) break;

                    remain -= rbyte;

                    tempbuff += remain;

             }

             fclose(ffile);

 

             //load font face.

             FT_Face fontface = NULL;

             error=FT_New_Memory_Face(_library, fontFile, fontFileSize, 0, &fontface);

             if (error || fontface ==NULL)

            

             {

                    return 0;

             }

             //check font type flag

             FT_UShort flag = FT_Get_FSType_Flags(fontface);

             switch(flag)

             {

                    case FT_FSTYPE_INSTALLABLE_EMBEDDING:

                    {//Fonts with no fsType bit set may be embedded and permanently installed on the remote system by an application.

                           printf("Font Type INSTALLABLE_EMBEDDING:  %d \n", flag);

                           break;

                    }

                    case FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING:

                    {//Fonts that have only this bit set must not be modified, embedded or exchanged in any manner without first obtaining

                     //permission of the font software copyright owner.

                           printf("Font Type RESTRICTED_LICENSE_EMBEDDING:  %d \n", flag);

                           break;

                    }

                    case FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING:

                    {//If this bit is set, the font may be embedded and temporarily loaded on the remote system. Documents

                     //containing Preview & Print fonts must be opened ‘read-only’; no edits can be applied to the document.

                           printf("Font Type PREVIEW_AND_PRINT_EMBEDDING:  %d \n", flag);

                           break;

                    }

                    case FT_FSTYPE_EDITABLE_EMBEDDING:

                    {//If this bit is set, the font may be embedded but must only be installed temporarily on other systems.

                     //In contrast to Preview & Print fonts, documents containing editable fonts may be opened for reading,

                     //editing is permitted, and changes may be saved.

                           printf("Font Type EDITABLE_EMBEDDING:  %d \n", flag);

                           break;

                    }

                    case FT_FSTYPE_NO_SUBSETTING:

                    {//If this bit is set, the font may not be subsetted prior to embedding.

                           printf("Font Type NO_SUBSETTING:  %d \n", flag);

                           break;

                    }

                    case FT_FSTYPE_BITMAP_EMBEDDING_ONLY:

                    {//If this bit is set, only bitmaps contained in the font may be embedded; no outline data may be embedded.

                    //If there are no bitmaps available in the font, then the font is unembeddable.

                           printf("Font Type BITMAP_EMBEDDING_ONLY:  %d \n", flag);

                           break;

                    }

                    default:

                    {

                           printf("Font Type unknow:  %d \n", flag);

                           break;

                    }

             }

 

             FT_Done_Face(fontface);

             fontface = NULL;

 

       }

 

       if(_library != NULL)

       {

             FT_Done_FreeType(_library);

             _library = NULL;

       }

       return 1;

}

 

--- End of Test Code ---

 

 

Thank you for your help

 

Jun Dai

_______________________________________________
Freetype mailing list
Freetype <at> nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype

Gmane