Class: FT2::SizeMetrics

Inherits:
Object
  • Object
show all
Defined in:
ext/ft2-ruby/ft2.c

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initializeObject

Constructor for FT2::SizeMetrics class.

This method is currently empty. You should never call this method directly unless you’re instantiating a derived class (ie, you know what you’re doing).



2300
2301
2302
# File 'ext/ft2-ruby/ft2.c', line 2300

static VALUE ft_size_metrics_init(VALUE self) {
  return self;
}

Instance Method Details

#x_ppemObject

Get the X pixels per EM of this FT2::SizeMetrics object.

Description:

x_ppem stands for the size in integer pixels of the EM square.
which also is the horizontal character pixel size.

Examples:

x_ppem = face.size.metrics.x_ppem


2315
2316
2317
2318
2319
# File 'ext/ft2-ruby/ft2.c', line 2315

static VALUE ft_size_metrics_x_ppem(VALUE self) {
  FT_Size_Metrics *size_metrics;
  Data_Get_Struct(self, FT_Size_Metrics, size_metrics);
  return INT2FIX((int) (*size_metrics).x_ppem);
}

#x_scaleObject

Get the horizontal scale of a FT2::SizeMetrics object.

Description:

Scale that is used to directly scale horizontal distances from
design space to 1/64th of device pixels.

Examples:

x_scale = face.size.metrics.x_scale


2349
2350
2351
2352
2353
# File 'ext/ft2-ruby/ft2.c', line 2349

static VALUE ft_size_metrics_x_scale(VALUE self) {
  FT_Size_Metrics *size_metrics;
  Data_Get_Struct(self, FT_Size_Metrics, size_metrics);
  return INT2FIX((int) (*size_metrics).x_scale);
}

#y_ppemObject

Get the Y pixels per EM of this FT2::SizeMetrics object.

Description:

y_ppem stands for the size in integer pixels of the EM square.
which also is the vertical character pixel size.

Examples:

y_ppem = face.size.metrics.y_ppem


2332
2333
2334
2335
2336
# File 'ext/ft2-ruby/ft2.c', line 2332

static VALUE ft_size_metrics_y_ppem(VALUE self) {
  FT_Size_Metrics *size_metrics;
  Data_Get_Struct(self, FT_Size_Metrics, size_metrics);
  return INT2FIX((int) (*size_metrics).y_ppem);
}

#y_scaleObject

Get the vertical scale of a FT2::SizeMetrics object.

Description:

Scale that is used to directly scale vertical distances from
design space to 1/64th of device pixels.

Examples:

y_scale = face.size.metrics.y_scale


2366
2367
2368
2369
2370
# File 'ext/ft2-ruby/ft2.c', line 2366

static VALUE ft_size_metrics_y_scale(VALUE self) {
  FT_Size_Metrics *size_metrics;
  Data_Get_Struct(self, FT_Size_Metrics, size_metrics);
  return INT2FIX((int) (*size_metrics).y_scale);
}