Subversion Repositories Kolibri OS

Rev

Rev 3584 | Blame | Last modification | View Log | RSS feed

  1. --------------------------------------------------------------------------------
  2.   Build Instructions for Framebuffer NetSurf                  13 February 2010
  3. --------------------------------------------------------------------------------
  4.  
  5.   This document provides instructions for building the Framebuffer version of
  6.   NetSurf and provides guidance on obtaining NetSurf's build dependencies.
  7.  
  8.   Framebuffer NetSurf has been tested on Ubuntu and Debian.
  9.  
  10.   Building and executing NetSurf
  11. ================================
  12.  
  13.   First of all, you should examine the contents of Makefile.defaults
  14.   and enable and disable relevant features as you see fit in a
  15.   Makefile.config file.  Some of these options can be automatically
  16.   detected and used, and where this is the case they are set to such.
  17.   Others cannot be automatically detected from the Makefile, so you
  18.   will either need to install the dependencies, or set them to NO.
  19.  
  20.   You should then obtain NetSurf's dependencies, keeping in mind which options
  21.   you have enabled in the configuration file.  See the "Obtaining NetSurf's
  22.   dependencies" section for specifics.
  23.  
  24.   Once done, to build Framebuffer NetSurf on a UNIX-like platform, simply run:
  25.  
  26.       $ make TARGET=framebuffer
  27.  
  28.   If that produces errors, you probably don't have some of NetSurf's build
  29.   dependencies installed. See "Obtaining NetSurf's dependencies" below.
  30.   Or turn off the complaining features in your Makefile.config.  You may
  31.   need to "make clean" before attempting to build after installing the
  32.   dependencies.
  33.  
  34.   Run NetSurf by executing the "nsfb" program:
  35.  
  36.       $ ./nsfb
  37.  
  38.   | Note: NetSurf uses certain resources at run time.  In order to find these
  39.   |       resources, it searches three locations:
  40.   |
  41.   |           1. ~/.netsurf/
  42.   |           2. $NETSURFRES/
  43.   |           3. /usr/share/netsurf/
  44.   |
  45.   |       In the build tree, the resources are located at
  46.   |
  47.   |           framebuffer/res
  48.   |
  49.   |       Setting $NETSURFRES to point at the resources in the build tree
  50.   |       will enable you to run NetSurf from here without installation.
  51.   |       To do this, run:
  52.   |
  53.   |           export NETSURFRES=`pwd`/framebuffer/res
  54.  
  55.  
  56.   Fonts
  57. =======
  58.  
  59.   The framebuffer port currently has two choices for font
  60.   handling. The font handler may be selected at compile time by using
  61.   the NETSURF_FB_FONTLIB configuration key. Currently supported values
  62.   are internal and freetype
  63.  
  64.   Internal
  65. ----------
  66.  
  67.   The internal font system has a single built in monospaced face with
  68.   CP467 encoding. The internal font plotter requires no additional
  69.   resources and is very fast, it is also aesthetically unappealing.
  70.  
  71.   Freetype
  72. ----------
  73.  
  74.   The freetype font system (freetype version 2 API is used) has
  75.   support for a number of different font file formats and faces. The
  76.   framebuffer font handler takes advantage of the freetype library
  77.   caching system to give good performance.
  78.  
  79.   The font glyphs are, by default, rendered as 256 level transparency
  80.   which gives excellent visual results even on small font sizes.
  81.  
  82.   The default font is the DejaVu trutype font set. The default path they
  83.   are sourced from is /usr/share/fonts/truetype/ttf-dejavu/ .
  84.  
  85.   The compiled in default paths may be altered by setting values in
  86.   the user configuration makefile Makefile.config. These values must
  87.   be set to teh absolute path of the relevant font file including its
  88.   .ttf extension. The variables are:
  89.  
  90.   NETSURF_FB_FONT_SANS_SERIF
  91.   NETSURF_FB_FONT_SANS_SERIF_BOLD
  92.   NETSURF_FB_FONT_SANS_SERIF_ITALIC
  93.   NETSURF_FB_FONT_SANS_SERIF_ITALIC_BOLD
  94.   NETSURF_FB_FONT_SERIF
  95.   NETSURF_FB_FONT_SERIF_BOLD
  96.   NETSURF_FB_FONT_MONOSPACE
  97.   NETSURF_FB_FONT_MONOSPACE_BOLD
  98.   NETSURF_FB_FONT_CURSIVE
  99.   NETSURF_FB_FONT_FANTASY
  100.  
  101.   The font selection may be changed by placing truetype font files
  102.   in the resources path. The resource files will be the generic names
  103.   sans_serif.ttf, sans_serif_bold.ttf etc.
  104.  
  105.   The font system is configured at runtime by several options. The
  106.   fb_font_monochrome option causes the renderer to use monochrome
  107.   glyph rendering which is faster to plot but slower to render and
  108.   much less visually appealing.
  109.  
  110.   The remaining seven options control the files to be used for font faces.
  111.  
  112.   fb_face_sans_serif - The sans serif face
  113.   fb_face_sans_serif_bold - The bold sans serif face
  114.   fb_face_sans_serif_italic - The italic sans serif face
  115.   fb_face_sans_serif_italic_bold - The bold italic sans serif face.
  116.   fb_face_serif - The serif font
  117.   fb_serif_bold - The bold serif font
  118.   fb_face_monospace - The monospaced font
  119.   fb_face_monospace_bold - The bold monospaced font
  120.   fb_face_cursive - The cursive font
  121.   fb_face_fantasy - The fantasy font
  122.  
  123.   Old Freetype
  124. --------------
  125.  
  126.   The framebuffer port Freetype font implementation was constructed
  127.   using a modern version of the library (2.3.5) to use versions 2.2.1
  128.   and prior the following patch is necessary.
  129.  
  130.  
  131. Index: framebuffer/font_freetype.c
  132. ===================================================================
  133. --- framebuffer/font_freetype.c (revision 6750)
  134. +++ framebuffer/font_freetype.c (working copy)
  135. @@ -311,6 +311,7 @@
  136.          FT_Glyph glyph;
  137.          FT_Error error;
  138.          fb_faceid_t *fb_face;
  139. +        FTC_ImageTypeRec trec;
  140.  
  141.          fb_fill_scalar(style, &srec);
  142.  
  143. @@ -318,15 +319,24 @@
  144.  
  145.          glyph_index = FTC_CMapCache_Lookup(ft_cmap_cache, srec.face_id, fb_face->cidx, ucs4);
  146.  
  147. -        error = FTC_ImageCache_LookupScaler(ft_image_cache,
  148. -                                            &srec,
  149. -                                            FT_LOAD_RENDER |
  150. -                                            FT_LOAD_FORCE_AUTOHINT |
  151. -                                            ft_load_type,
  152. -                                            glyph_index,
  153. -                                            &glyph,
  154. -                                            NULL);
  155.  
  156. +       trec.face_id = srec.face_id;
  157. +       if (srec.pixel) {
  158. +               trec.width = srec.width;
  159. +               trec.height = srec.height;
  160. +       } else {
  161. +               /* Convert from 1/64 pts to pixels */
  162. +               trec.width = srec.width * css_screen_dpi / 64 / srec.x_res;
  163. +               trec.height = srec.height * css_screen_dpi / 64 / srec.y_res;
  164. +       }
  165. +       trec.flags = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT | ft_load_type;
  166. +
  167. +       error = FTC_ImageCache_Lookup(ft_image_cache,
  168. +                                     &trec,
  169. +                                     glyph_index,
  170. +                                     &glyph,
  171. +                                     NULL);
  172. +
  173.          return glyph;
  174.  }
  175.  
  176.  
  177.   Selecting a frontend and appropriate options  
  178. ==============================================  
  179.  
  180.   The framebuffer port interfaces to its input and output devices
  181.   using the NetSurf Framebuffer library (libnsfb). This library
  182.   provides an abstraction layer to input and output devices.
  183.  
  184.   The surface used by libnsfb is selected by using the -f switch to
  185.   NetSurf when executed. A surface in this context is simply the
  186.   combination of input and output devices.
  187.  
  188.   A surface output device may be any linearly mapped area of
  189.   memory. The framebuffer may be treated as values at 32, 16 or 8 bits
  190.   per pixel. The input device is typically selected to complement the
  191.   output device and is completely specific to the surface.
  192.  
  193.   There are several configuration options which may influence the
  194.   framebuffer surfaces. These are:
  195.  
  196.     fb_refresh - The refresh rate (for physical displays)
  197.     fb_depth - The depth (in bits per pixel) of the framebuffer
  198.     window_width - The width of the framebuffer
  199.     window_height - The height of the framebuffer
  200.  
  201.   The defaults are for 800 by 600 pixels at 16bpp and 70Hz refresh rate.
  202.  
  203.   The documentation of libnsfb should be consulted for futher
  204.   information about supported frontends and their configuration.
  205.  
  206.  
  207.   Obtaining NetSurf's build dependencies
  208. ========================================
  209.  
  210.   Many of NetSurf's dependencies are packaged on various operating systems.
  211.   The remainder must be installed manually.  Currently, some of the libraries
  212.   developed as part of the NetSurf project have not had official releases.
  213.   Hopefully they will soon be released with downloadable tarballs and packaged
  214.   in common distros.  For now, you'll have to make do with Git checkouts.
  215.  
  216.   Package installation
  217. ----------------------
  218.  
  219.   Debian-like OS:
  220.  
  221.       $ apt-get install libcurl3-dev libmng-dev
  222.  
  223.   Recent OS versions might need libcurl4-dev instead of libcurl3-dev but
  224.   note that when it has not been built with OpenSSL, the SSL_CTX is not
  225.   available and results that certification details won't be presented in case
  226.   they are invalid.  But as this is currently unimplemented in the Framebuffer
  227.   flavour of NetSurf, this won't make a difference at all.
  228.  
  229.   Fedora:
  230.  
  231.       $ yum install curl-devel libmng-devel lcms-devel
  232.  
  233.   Other:
  234.  
  235.   You'll need to install the development resources for libcurl3 and libmng.
  236.  
  237.   Note that if you don't require MNG or JNG image support, NetSurf can be
  238.   configured to use libpng instead of libmng. If you wish to do this, install
  239.   the libpng development package instead.
  240.  
  241.   The NetSurf project's libraries
  242. ---------------------------------
  243.  
  244.   The NetSurf project has developed several libraries which are required by
  245.   the browser. These are:
  246.  
  247.   LibParserUtils  --  Parser building utility functions
  248.   LibWapcaplet    --  String internment
  249.   Hubbub          --  HTML5 compliant HTML parser
  250.   LibCSS          --  CSS parser and selection engine
  251.   LibNSGIF        --  GIF format image decoder
  252.   LibNSBMP        --  BMP and ICO format image decoder
  253.   LibROSprite     --  RISC OS Sprite format image decoder
  254.   LibNSFB         --  Framebuffer abstraction
  255.  
  256.   To fetch each of these libraries, run the appropriate commands from the
  257.   Docs/LIBRARIES file.
  258.  
  259.   To build and install these libraries, simply enter each of their directories
  260.   and run:
  261.  
  262.       $ sudo make install
  263.  
  264.   | Note: We advise enabling iconv() support in libparserutils, which vastly
  265.   |       increases the number of supported character sets.  To do this,
  266.   |       create a file called Makefile.config.override in the libparserutils
  267.   |       directory, containing the following line:
  268.   |
  269.   |           CFLAGS += -DWITH_ICONV_FILTER
  270.   |
  271.   |       For more information, consult the libparserutils README file.
  272.  
  273.   General requirements
  274. ----------------------
  275.  
  276.   Depending on the frontend selected the build may need specific
  277.   libraries installed, e.g. the SDL port requires SDL1.2 or later
  278.  
  279.   Installing these libraries will often will pull in loads of things,
  280.   like the PNG and JPEG libraries, colour management libraries, zlib,
  281.   OpenSSL etc that NetSurf also depends on.
  282.