syntax = "proto2";

/**
 * Open Source'd font metadata proto formats.
 */
package google.fonts_public;

option java_package = "com.google.fonts.proto";
option java_outer_classname = "FontsPublic";

message FamilyProto {
  required string name = 1;
  required string designer = 2;
  required string license = 3;
  repeated string category = 4;  // Only the LAST value is used by Google Fonts
  required string date_added = 5;
  repeated FontProto fonts = 6;
  repeated string aliases = 7;
  repeated string subsets = 8;
  optional string ttf_autohint_args = 9;
  repeated AxisSegmentProto axes = 10;
  map<string, float> registry_default_overrides = 11;
  optional SourceProto source = 12;
  optional bool is_noto = 13;
  repeated string languages = 14;
  repeated FamilyFallbackProto fallbacks = 15;
  map<string, string> sample_glyphs = 16;
  optional SampleTextProto sample_text = 17;
  optional string display_name = 18;
  repeated GlyphGroupProto ordered_sample_glyphs = 19;
  // Optional url for more info about the font.
  optional string minisite_url = 20;
  // The script to use when picking sample text. See the Script spanner table.
  optional string primary_script = 21;

  // Next = 22
}

message FontProto {
  required string name = 1;
  required string style = 2;
  required int32 weight = 3;
  required string filename = 4;
  required string post_script_name = 5;
  required string full_name = 6;
  optional string copyright = 7;
}

message AxisSegmentProto {
  optional string tag = 1;
  optional float min_value = 2;
  reserved 3;
  reserved "default_value";
  optional float max_value = 4;
  // Next = 5
}

message SourceProto {
  optional string repository_url = 1;
  optional string branch = 5;
  optional string commit = 2;
  optional string archive_url = 3;
  repeated SourceFileProto files = 4;
  // Next = 6
}

// A file to take from source and where to put it in dest
// Ex web/split/Roboto[wdth,wght].ttf => Roboto[wdth,wght].ttf
message SourceFileProto {
  optional string source_file = 1;
  optional string dest_file = 2;
}

enum TargetTypeProto {
  TARGET_UNSPECIFIED = 0;
  TARGET_OS_WINDOWS = 1;
  TARGET_OS_MAC = 2;
  TARGET_OS_LINUX = 3;
  TARGET_OS_ANDROID = 4;
  TARGET_OS_IOS = 5;
}

// Message so we can add additional fields like value in future
message TargetProto {
  optional TargetTypeProto target_type = 1;  //  e.g., OS
}

message FamilyFallbackProto {
  repeated AxisSegmentProto axis_target = 1;  // activate for this region
  repeated TargetProto target = 2;            // activate for any of these
  optional float size_adjust_pct = 3;         // e.g. 90%
  optional float ascent_override_pct = 5;     // e.g. 110%
  repeated string local_src = 4;  // e.g. Impact; the local family to use
  // Next = 6
}

// Corresponds to SampleTextProto in
// google3/java/com/google/fonts/backend/spanner/google_fonts_proto.proto
message SampleTextProto {
  optional string masthead_full = 1;
  optional string masthead_partial = 2;
  optional string styles = 3;
  optional string tester = 4;
  optional string poster_sm = 5;
  optional string poster_md = 6;
  optional string poster_lg = 7;
  optional string specimen_48 = 8;
  optional string specimen_36 = 9;
  optional string specimen_32 = 10;
  optional string specimen_21 = 11;
  optional string specimen_16 = 12;
}

message GlyphGroupProto {
  optional string name = 1;
  optional string glyphs = 2;
}
