예제 #1
0
void column_justify()
{
    vunits height;
    if (!the_column->is_active())
        error("can't justify column - column not active");
    else if (get_vunits(&height, 'v')) {
        justification_spec js(height);
        symbol nm = get_long_name(1);
        if (!nm.is_null()) {
            vunits v;
            if (get_vunits(&v, 'v')) {
                js.append(nm, v);
                int err = 0;
                while (has_arg()) {
                    nm = get_long_name(1);
                    if (nm.is_null()) {
                        err = 1;
                        break;
                    }
                    if (!get_vunits(&v, 'v')) {
                        err = 1;
                        break;
                    }
                    js.append(nm, v);
                }
                if (!err)
                    the_column->justify(js);
            }
        }
    }
    skip_line();
}
예제 #2
0
파일: div.cpp 프로젝트: Distrotech/groff
void page_length()
{
  vunits n;
  if (has_arg() && get_vunits(&n, 'v', topdiv->get_page_length()))
    topdiv->set_page_length(n);
  else
    topdiv->set_page_length(11*units_per_inch);
  skip_line();
}
예제 #3
0
파일: div.cpp 프로젝트: Distrotech/groff
void need_space()
{
  vunits n;
  if (!has_arg() || !get_vunits(&n, 'v'))
    n = curenv->get_vertical_spacing();
  while (!tok.newline() && !tok.eof())
    tok.next();
  curdiv->need(n);
  tok.next();
}
예제 #4
0
파일: div.cpp 프로젝트: Distrotech/groff
void return_request()
{
  vunits dist = curdiv->marked_place - curdiv->get_vertical_position();
  if (has_arg()) {
    if (tok.ch() == '-') {
      tok.next();
      vunits x;
      if (get_vunits(&x, 'v'))
	dist = -x;
    }
    else {
      vunits x;
      if (get_vunits(&x, 'v'))
	dist = x >= V0 ? x - curdiv->get_vertical_position() : V0;
    }
  }
  if (dist < V0)
    curdiv->space(dist);
  skip_line();
}
예제 #5
0
파일: div.cpp 프로젝트: Distrotech/groff
void save_vertical_space()
{
  vunits x;
  if (!has_arg() || !get_vunits(&x, 'v'))
    x = curenv->get_vertical_spacing();
  if (curdiv->distance_to_next_trap() > x)
    curdiv->space(x, 1);
  else
    saved_space = x;
  skip_line();
}
예제 #6
0
파일: div.cpp 프로젝트: Distrotech/groff
void change_trap()
{
  symbol s = get_name(1);
  if (!s.is_null()) {
    vunits x;
    if (has_arg() && get_vunits(&x, 'v'))
      topdiv->change_trap(s, x);
    else
      topdiv->remove_trap(s);
  }
  skip_line();
}
예제 #7
0
파일: div.cpp 프로젝트: Distrotech/groff
void when_request()
{
  vunits n;
  if (get_vunits(&n, 'v')) {
    symbol s = get_name();
    if (s.is_null())
      topdiv->remove_trap_at(n);
    else
      topdiv->add_trap(s, n);
  }
  skip_line();
}
예제 #8
0
파일: div.cpp 프로젝트: Distrotech/groff
void diversion_trap()
{
  vunits n;
  if (has_arg() && get_vunits(&n, 'v')) {
    symbol s = get_name();
    if (!s.is_null())
      curdiv->set_diversion_trap(s, n);
    else
      curdiv->clear_diversion_trap();
  }
  else
    curdiv->clear_diversion_trap();
  skip_line();
}
예제 #9
0
파일: div.cpp 프로젝트: Distrotech/groff
void space_request()
{
  postpone_traps();
  if (break_flag)
    curenv->do_break();
  vunits n;
  if (!has_arg() || !get_vunits(&n, 'v'))
    n = curenv->get_vertical_spacing();
  while (!tok.newline() && !tok.eof())
    tok.next();
  if (!unpostpone_traps() && !curdiv->no_space_mode)
    curdiv->space(n);
  else
    // The line might have had line spacing that was truncated.
    truncated_space += n;
  
  tok.next();
}