code: private void determineAscDesc() {
          int hheaBoxHeight = hheaAscender - hheaDescender;
          int os2BoxHeight = os2Ascender - os2Descender;
          if (os2Ascender > 0 && os2BoxHeight <= upem) {
              ascender = os2Ascender;
              descender = os2Descender;
          } else if (hheaAscender > 0 && hheaBoxHeight <= upem) {
              ascender = hheaAscender;
              descender = hheaDescender;
          } else {
              if (os2Ascender > 0) {
                  //Fall back to info from OS/2 if possible
                  ascender = os2Ascender;
                  descender = os2Descender;
              } else {
                  ascender = hheaAscender;
                  descender = hheaDescender;
              }
          }
  
          log.debug("Font box height: " + (ascender - descender));
          if (ascender - descender > upem) {
              log.warn("Ascender and descender together are larger than the em box."
                      + " This could lead to a wrong baseline placement in Apache FOP.");
          }
      }
docs: Determines the right source for the ascender and descender values. The problem here is
  that the interpretation of these values is not the same for every font. There doesn't seem
  to be a uniform definition of an ascender and a descender. In some fonts
  the hhea values are defined after the Apple interpretation, but not in every font. The
  same problem is in the OS/2 table. FOP needs the ascender and descender to determine the
  baseline so we need values which add up more or less to the "em box". However, due to
  accent modifiers a character can grow beyond the em box.